Skip to content

Instantly share code, notes, and snippets.

View jhchabran's full-sized avatar
🧀

Jean-Hadrien Chabran jhchabran

🧀
View GitHub Profile
@jhchabran
jhchabran / keybindings.cson
Created May 20, 2014 06:21
Current Atom keybindings
'.vim-mode:not(.insert-mode)':
'space space': 'command-palette:toggle'
'space w': 'core:save'
'space q': 'core:close'
'space f': 'fuzzy-finder:toggle-file-finder'
'space c': 'git-plus:commit'
'space a': 'git-plus:add'
@jhchabran
jhchabran / whisky.md
Last active August 29, 2015 14:01
Whisky.md
  • Talisker 57 North
  • Linkwood 20 years anniversary (can't find the bottle anywhere)
@jhchabran
jhchabran / README.md
Last active August 29, 2015 14:04
Rails + ClojureScript
  • Drop project.clj in Rails root
  • copy _clojurescript.html.erb into /app/views/shared/
  • update your layout according to application.html.erb
  • replace project-name by your project name
  • run the following:
lein cljsbuild auto &
bundle exec rails s
http://vk.com/wall2051158_6783
@jhchabran
jhchabran / colors_overrides.json
Created March 30, 2015 16:39
Solarized color overrides for Chrome Shell extension, don't know where I found this
{"0":"#073642","1":"#dc322f","2":"#859900","3":"#b58900","4":"#268bd2","5":"#d33682","6":"#2aa198","7":"#eee8d5","8":"#002b36","9":"#cb4b16","10":"#586e75","11":"#657b83","12":"#839496","13":"#6c71c4","14":"#93a1a1","15":"#fdf6e3"}
class IO
def readbytes(n)
str = read(n)
if str == nil
raise EOFError, "End of file reached"
end
if str.size < n
raise TruncatedDataError.new("data truncated", str)
end
str
class RestfulActions
include Singleton
Action = Struct.new(:name, :method, :args)
@@actions = []
[
[:index, :get],
[:new, :get],
[:show, :get, {:id => 1}],
# custom matchers to expect layouts
Spec::Matchers.define :use_layout do |layout|
match do |response|
response.layout == layout
end
failure_message_for_should do |employee|
"expected response to use layout named #{layout}"
end
failure_message_for_should_not do |employee|
"expected response to not use layout named #{layout}"