Skip to content

Instantly share code, notes, and snippets.

@fffx
fffx / permissions.txt
Last active April 5, 2017 00:55
cancan permissions
+------------+
|permissions |
+-----+------+
|
has_many through +----+ permission_id
| +--------------------+
+-----^+-> | role_permissions |
| +--------------------+
has_many through +----+ role_id
+
@fffx
fffx / tools_list.org
Last active April 14, 2017 02:04
Things I really love

Terminal

  • tmux
    • tmuxinator
  • git
    • tig
    • diff-so-fancy
  • proxy
    • proxychains(proxychains-ng)
    • privoxy
    • tsocks
@fffx
fffx / Proc & Lambda
Last active April 12, 2017 03:32
rails & ruby
#difference between proc and
@fffx
fffx / fcitx.txt
Created April 12, 2017 04:03
fcitx
快速输入
确保在 ~/.config/fcitx/config 里把 SemiColonAction 修改为 QuickPhrase.
创建 ~/.config/fcitx/data/QuickPhrase.mb, 文件内容示范如下:
#第一个字符为“#”的行是注释
#格式:编码 符号
#数学符号
dianhua 123456789
youbian 123456
dizhi 中华人民共和国北京市长安街一号
@fffx
fffx / ubuntu-setup.md
Last active August 8, 2017 08:56
my ubuntu-gnome setup

sudo without password for fangxing

#open this file with sudo visudo -f
/etc/sudoers.d/fangxing
fangxing ALL=(ALL) NOPASSWD:ALL

install

sudo apt-get install -f mysql libmysqlclient-dev redis-server git git-extras \
@fffx
fffx / gist:0b4e946decc45ff594b25865fa701855
Created April 26, 2017 11:44
restore ubuntu session from suspend
ctrl-alt-f7
@fffx
fffx / gist:502d7af221bed052bb5a058933553e2e
Last active April 28, 2017 03:11
zeus c , Ctrl-D cause terminal mess up
fix
```shell
$ stty sane
```
@fffx
fffx / spacemacs-cheshe.md
Created May 22, 2017 09:39
Spacemacs Cheat Sheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
  • SPC TAB - switch to previous buffer
  • SPC b b - switch buffers
@fffx
fffx / zshrc
Created May 23, 2017 01:36
tmux auto start sesion
if [[ -z "$TMUX" ]]
then
ID="`tmux ls | grep -vm1 attached | cut -d: -f1`"
if [[ -z "$ID" ]]
then
tmux new-session
else
tmux attach-session -t "$ID"
fi
fi
@fffx
fffx / readme.md
Created June 3, 2017 07:27
install crouton in chrome book c720

Install crounton

Enable Developer Mode

  1. Hold Esc + Refresh and then press the power button. The Chromebook will restart and give a warning about the OS being missing or damaged Press Ctrl + D to bypass this message. It will now ask if you want to turn os verification off. Press Return to continue into developer mode
  2. The Chromebook will now prepare the os for developer mode. Just leave this to run for a good few minutes. It will boot backup to chrome when finished. Everytime you restart you chromebook from now on you will get an OS verification warning. you can either wait 30 seconds and the Chromebook will boot, or you can skip this message by pressing Ctrl + D