Skip to content

Instantly share code, notes, and snippets.

@will-clarke
will-clarke / Sublime-Keymap
Last active August 29, 2015 14:06
user default.sublime-keymap
{ "keys": ["ctrl+shift+."], "command": "erb"},
{ "keys": ["j", "j"], "command": "_enter_normal_mode", "args": {"mode": "mode_insert"}, "context": [{"key": "vi_insert_mode_aware"}] },
{ "keys": ["j", "k"], "command": "_enter_normal_mode", "args": {"mode": "mode_insert"}, "context": [{"key": "vi_insert_mode_aware"}] },
{ "keys": ["J", "J"], "command": "_enter_normal_mode", "args": {"mode": "mode_insert"}, "context": [{"key": "vi_insert_mode_aware"}] },
{ "keys": ["J", "K"], "command": "_enter_normal_mode", "args": {"mode": "mode_insert"}, "context": [{"key": "vi_insert_mode_aware"}] },
{ "keys": ["ctrl+shift+k"], "command":"next_view"},
{ "keys": ["ctrl+shift+j"], "command":"prev_view"},
{"keys": ["K"], "command":"next_view", "context": [{"key": "vi_command_mode_aware"}]},
{"keys": ["J"], "command":"prev_view", "context": [{"key": "vi_command_mode_aware"}]}
" sneak
nmap ' <Plug>SneakNext
nmap " <Plug>SneakPrevious
" nmap s <Plug>SneakForward
" nmap S <Plug>SneakBackward
" xmap s <Plug>VSneakForward
" xmap S <Plug>VSneakBackward
"
" To remember how to force save if you have an E212 error message
ca w!! w !sudo tee "%"
Bundle "christoomey/vim-tmux-navigator"
Bundle "t9md/vim-ruby-xmpfilter"
Bundle "thoughtbot/vim-rspec"
Bundle "csexton/jekyll.vim"
nmap ,u :GundoToggle<CR> # !> assigned but unused variable - nmap
" RSpec.vim mappings
noremap <Leader>t :call RunCurrentSpecFile()<CR>
noremap <Leader>s :call RunNearestSpec()<CR>
noremap <Leader>l :call RunLastSpec()<CR>
noremap <Leader>a :call RunAllSpecs()<CR>
" sneak # !> possibly useless use of > in void context
#
# Executes commands at the start of an interactive session.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
nmap ,u :GundoToggle<CR> # !> assigned but unused variable - nmap
" RSpec.vim mappings
noremap <Leader>t :call RunCurrentSpecFile()<CR>
noremap <Leader>s :call RunNearestSpec()<CR>
noremap <Leader>l :call RunLastSpec()<CR>
noremap <Leader>a :call RunAllSpecs()<CR>
" sneak # !> possibly useless use of > in void context
nmap ,u :GundoToggle<CR> # !> assigned but unused variable - nmap
" RSpec.vim mappings
noremap <Leader>t :call RunCurrentSpecFile()<CR>
noremap <Leader>s :call RunNearestSpec()<CR>
noremap <Leader>l :call RunLastSpec()<CR>
noremap <Leader>a :call RunAllSpecs()<CR>
" sneak # !> possibly useless use of > in void context
nmap ,u :GundoToggle<CR> # !> assigned but unused variable - nmap
" RSpec.vim mappings
noremap <Leader>t :call RunCurrentSpecFile()<CR>
noremap <Leader>s :call RunNearestSpec()<CR>
noremap <Leader>l :call RunLastSpec()<CR>
noremap <Leader>a :call RunAllSpecs()<CR>
" sneak # !> possibly useless use of > in void context
require 'mechanize'
require 'open-uri'
a = Mechanize.new
(1..20).each do |i|
page = a.get("http://xkcd.com/#{i}/")
leading_zeros = "%04d" % i
if page.parser.css('#comic')
image_url = page.parser.css('#comic').children[1].first[1].to_s
a.get( a.get(image_url) ).save_as "#{leading_zeros}-#{a.get(image_url).filename}"
end
require 'mechanize'
require 'open-uri'
a = Mechanize.new
(41..50).each do |i|
page = a.get("http://www.explosm.net/comics/#{i}/")
# image_url = page.image.first.url.to_s
leading_zeros = "%04d" % i
if page.image_with(alt: "Cyanide and Happiness, a daily webcomic")
image_url = page.image_with(alt: "Cyanide and Happiness, a daily webcomic").url.to_s
a.get( a.get(image_url) ).save_as "#{leading_zeros}-#{a.get(image_url).filename}"