Skip to content

Instantly share code, notes, and snippets.

View Fykec's full-sized avatar

yinjiaji Fykec

View GitHub Profile
@Fykec
Fykec / USING-DIFFMERGE.md
Last active November 11, 2021 07:20 — forked from smoll/USING-DIFFMERGE.md
Using DiffMerge as your git mergetool (for Mac OS X / macOS)
@Fykec
Fykec / DefaultplusEmacs.idekeybings
Last active December 15, 2023 08:48
Setup Emacs keybindings in XCode
<?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>
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)
@Fykec
Fykec / v2tov3.sql
Last active June 14, 2017 03:45
Demo: v2 to v3 sqlite3
/* 更新数据表结构*/
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;
@Fykec
Fykec / sqlites_migration_run.sh
Last active June 14, 2017 03:39
Sqlite3 Migration Script
#!/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
@Fykec
Fykec / sslocal.service
Created May 16, 2017 07:15 — forked from ygmpkk/sslocal.service
ShadowSocks Client Systemd Service
[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]
<!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;}
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
@Fykec
Fykec / objc.cfg
Last active August 29, 2015 13:57 — forked from tszming/objc.cfg
#
# 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
@Fykec
Fykec / debug_all_selectors
Created February 20, 2014 03:16
Xcode Debug Console show all selectors
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]))); }