Skip to content

Instantly share code, notes, and snippets.

Yay
puts ->() {
compose = ->(f, g) {
->(n) { f.(g.(n)) }
}
make_adder = ->(x) {
->(n) { n + x }
}
add1 = make_adder.(1)
if [[ -n $SSH_CONNECTION ]]; then
PROMPT='%{$fg_bold[green]%}λ%{$reset_color%} %~ '
else
PROMPT='%{$fg_bold[green]%}➜%{$reset_color%} %~ $(git_prompt_info)%{$reset_color%}'
fi
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"
api = new Api
sinon.stub(api, 'fetchFoo').returns(Q.resolve({}))
sinon.stub(api, 'fetchBar').returns(Q.resolve({}))
Q.all [
api.fetchFoo
api.fetchBar
].then (data) ->
console.log "4. Profit"
{label, select, option, p, button} = React.DOM
p {}, "Some content"
buildTag = (tag) ->
(options...) ->
options.unshift {} if options.length is 1
React.DOM[tag].apply @, options
DOM = (->
constructor = (spec) ->
that = otherConstructor(spec)
method = ->
doStuff()
that.method = method
that
@mixin with-context {
@content;
@include susy-breakpoint($medium, 9) { @content };
@include susy-breakpoint($large, 12) { @content };
}
@kalasjocke
kalasjocke / Dockerfile
Created February 25, 2019 15:20
Dockerfile with node dependency management
FROM node:8.15.0-alpine
ENV NODE_ENV=development
RUN mkdir /usr/dependencies
COPY package.json /usr/dependencies
COPY yarn.lock /usr/dependencies
WORKDIR /usr/dependencies
RUN yarn
ENV NODE_PATH=/usr/dependencies/node_modules