Reference(s):
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Menu Key Bindings</key> | |
<dict> | |
<key>Key Bindings</key> | |
<array> | |
<dict> | |
<key>Action</key> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "golang.org/x/tour/tree" | |
// Walk walks the tree t sending all values | |
// from the tree to the channel ch. | |
func Walk(t *tree.Tree, ch chan int) { | |
if t.Left != nil { | |
Walk(t.Left, ch) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 更新数据表结构*/ | |
CREATE TABLE IF NOT EXISTS "mapping_user_plan" ( | |
"id" integer PRIMARY KEY, | |
"user_id" integer, | |
"plan_id" integer, | |
"created_at" text | |
); | |
/* 也可以更新数据 */ | |
insert into mapping_user_plan(user_id, plan_id, created_at) select 1, id, created_at from plan; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
## 数据库路径名 | |
db_file="demo.db" | |
## 当前最新版本 | |
cur_version=1 | |
# 检查 sqlite3 命令行 工具是否已经安装 | |
if ! [ -x "$(command -v sqlite3)" ]; then | |
echo 'Error: sqlite3 is not installed.' >&2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Daemon to start Shadowsocks Client | |
Wants=network-online.target | |
After=network.target | |
[Service] | |
Type=simple | |
ExecStart=/usr/bin/sslocal -c /etc/shadowsocks/client.json --pid-file /var/run/sslocal.pid --log-file /var/log/sslocal.log | |
[Install] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
/*CSS reset*/ | |
body{font-size: 16px; line-height: 1.6;} | |
*{padding:0;margin: 0; box-sizing: border-box;} | |
ul, ol{list-style: none;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wopen { # via https://gist.github.com/coryalder/5609996 | |
WORKSPACE="${PWD##*/}.xcworkspace" | |
PROJECT="${PWD##*/}.xcodeproj" | |
if [ -a $WORKSPACE ]; then | |
open $WORKSPACE; | |
elif [ -a $PROJECT ]; then | |
open $PROJECT; | |
else | |
echo "No workspace or project found."; | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# uncrustify config file for objective-c and objective-c++ | |
# | |
indent_with_tabs = 0 # 1=indent to level only, 2=indent with tabs | |
output_tab_size = 4 # new tab size | |
indent_columns = output_tab_size | |
indent_label = 2 # pos: absolute col, neg: relative column | |
indent_align_assign = FALSE | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p int $num = 0; | |
expr Method *$m = (Method *)class_copyMethodList((Class)object_getClass(self), &$num); | |
expr for(int i=0;i<$num;i++) { (void)NSLog(@"%s",(char *)sel_getName((SEL)method_getName($m[i]))); } |
NewerOlder