Skip to content

Instantly share code, notes, and snippets.

=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@algo31031
algo31031 / gist:8aafda898cfb6b69ab83
Created July 29, 2014 04:36
Sublime Text 2 快捷键
Ctrl+D 选词 (反复按快捷键,即可继续向下同时选中下一个相同的文本进行同时编辑)
Ctrl+G 跳转到相应的行
Ctrl+J 合并行(已选择需要合并的多行时)
Ctrl+L 选择整行(按住-继续选择下行)
Ctrl+M 光标移动至括号内开始或结束的位置
Ctrl+T 词互换
Ctrl+U 软撤销
Ctrl+P 查找当前项目中的文件和快速搜索;输入 @ 查找文件主标题/函数;或者输入 : 跳转到文件某行;
Ctrl+R 快速列出/跳转到某个函数
Ctrl+K Backspace 从光标处删除至行首
@algo31031
algo31031 / nginx.conf
Created July 11, 2014 01:48
aidou nginx config
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@algo31031
algo31031 / Gemfile
Last active August 29, 2015 14:02
some common config for RSpec, FactoryGirl, Capybara
group :development, :test do
gem "rspec-rails"
gem 'rspec-collection_matchers'
gem "factory_girl_rails"
gem "spring-commands-rspec"
gem "spring-commands-cucumber"
gem "guard-rspec"
end
group :test do
@algo31031
algo31031 / gist:a442190afa8f6a58ee14
Created May 30, 2014 05:25
get width / height / ratio of a video , using mediainfo
mediainfo '--Inform=Video; %Width% %Height% %DisplayAspectRatio/String%' video.mp4

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@algo31031
algo31031 / gist:61ab8afd37e51d4fd0d2
Last active August 29, 2015 14:01 — forked from HashNuke/gist:608259
to undo push and commits
# to undo a git push
git push -f origin HEAD^:master
# to get to previous commit (preserves working tree)
git reset --soft HEAD
# to get back to previous commit (you'll lose working tree)
git reset --hard HEAD^
@algo31031
algo31031 / gist:d226765a132c185fc81f
Last active August 29, 2015 14:01
install ffmpeg on ubuntu 14.04
sudo su
echo "deb http://www.deb-multimedia.org testing main" >> /etc/apt/sources.list
exit
sudo apt-get update
sudo apt-get install deb-multimedia-keyring
sudo apt-get remove ffmpeg x264 libx264-dev
sudo apt-get update