This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
patch: | |
# 菜单 | |
menu: | |
page_size: 8 # 候选词个数 | |
# alternative_select_labels: [ ①, ②, ③, ④, ⑤, ⑥, ⑦, ⑧, ⑨, ⑩ ] # 修改候选项标签 | |
# alternative_select_keys: ASDFGHJKL # 如编码字符占用数字键,则需另设选字键 | |
# ascii_mode、inline、no_inline、vim_mode 等等设定,可参考 /Library/Input Methods/Squirrel.app/Contents/SharedSupport/squirrel.yaml | |
# 中西文切换 | |
# | |
# 【good_old_caps_lock】 CapsLock 切换到大写或切换中英。 |
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
#!/bin/bash | |
############################################################################################ | |
# WARNING: THESE SCRIPTS AND CHANGES ARE NOT MEANT FOR ANYBODY BUT ME. | |
# RUNNING THESE WILL MESS UP YOUR COMPUTER IN MYSTERIOUS AND USUALLY UNRECOVERABLE WAYS. | |
############################################################################################ | |
if [[ "$(sw_vers -productVersion)" != 10\.15* ]]; then | |
echo "This is only meant to run on macOS 10.15.* Catalina" >&2 | |
exit 1 |
object PomToSbt extends App { | |
import scala.xml._ | |
val lines = (XML.load("pom.xml") \\ "dependencies") \ "dependency" map { dependency => | |
val groupId = (dependency \ "groupId").text | |
val artifactId = (dependency \ "artifactId").text | |
val version = (dependency \ "version").text | |
val scope = (dependency \ "scope").text | |
val classifier = (dependency \ "classifier").text |
<template> | |
<div> | |
<vue-editor v-model="content" ref="editor" :editor-options="toolbarOptions" @text-change="updateValue" useCustomImageHandler @imageAdded="uploadImage"></vue-editor> | |
</div> | |
</template> | |
<script> | |
import Vue from "vue"; | |
import axios from 'axios' | |
let VueEditor, Quill; |
Errors from Laravel logs:
MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.
ERR Error running script (call to f_1af8e79ebe56ad4d7910f2e116e2555983099baf): @user_script:8: @user_script: 8: -MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.
Errors from Redis logs (/var/log/redis/redis-server.log
):
* 1 changes in 900 seconds. Saving...
let re; | |
//this looks for the string between the slashes. it'll match hello but not HeLlo. | |
re = /hello/; | |
//the lower case i means be case insensitive. this will match HellO. | |
re = /hello/i; | |
// explaination for common search characters |
#!/bin/sh | |
# script to convert mysql schema to be compatible with data warehouse software | |
# make sure that s3cmd and maatkit utility is installed | |
db_name=${1:-'test'} | |
> /root/$db_name.txt | |
temppath='/mnt/data/pdump1' | |
host='localhost' | |
user='maatkit' |
const waitFor = (ms) => new Promise(r => setTimeout(r, ms)) | |
const asyncForEach = async (array, callback) => { | |
for (let index = 0; index < array.length; index++) { | |
await callback(array[index], index, array) | |
} | |
} | |
const start = async () => { | |
await asyncForEach([1, 2, 3], async (num) => { | |
await waitFor(50) |
My Elasticsearch cheatsheet with example usage via rest api (still a work-in-progress)