Skip to content

Instantly share code, notes, and snippets.

@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 / gist:0b4e946decc45ff594b25865fa701855
Created April 26, 2017 11:44
restore ubuntu session from suspend
ctrl-alt-f7
@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 / 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 / Proc & Lambda
Last active April 12, 2017 03:32
rails & ruby
#difference between proc and
@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 / 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 / .pryrc
Created March 31, 2017 07:40 — forked from bespokoid/.pryrc
# === EDITOR ===
Pry.editor = 'vim'
# == Pry-Nav - Using pry as a debugger ==
Pry.commands.alias_command 'c', 'continue' rescue nil
Pry.commands.alias_command 's', 'step' rescue nil
Pry.commands.alias_command 'n', 'next' rescue nil
Pry.commands.alias_command 'r!', 'reload!' rescue nil
Pry.config.color = true
@fffx
fffx / solution.md
Last active March 31, 2017 05:31
webpack-dev-server detect file changes and auto compile in ubuntu 16.04

$ webpack-dev-server --content-base ./ --port <port> --hot

#检测文件改动webpack 是否察觉 webpack --watch --progress

#如果改动文件(并保存), webpack没有察觉 , 则执行

$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

@fffx
fffx / index.md
Created March 16, 2017 03:33 — forked from rstacruz/index.md
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one