Skip to content

Instantly share code, notes, and snippets.

View unders's full-sized avatar

Anders Törnqvist unders

  • Functionbox
  • Göteborg, Sweden
View GitHub Profile
@unders
unders / keybindings.md
Last active February 7, 2016 13:06
webstorm

Key mappings Categories

Editing, Running, Debugging, Navigation, refactoring, vcs, General

Key mappings

OS X Action Windows
            | Usage Search                   | 

Cmd Alt U | Show Usage in File | Cmd Alt Ctrl U | Show usage in Project |

@unders
unders / minimal docker
Last active August 29, 2015 14:27
A mininal docker file
FROM gliderlabs/alpine:3.2 # 1. tiny container
MAINTAINER: Anders Törnqvist <...@...com>
RUN apk add --update ca-certificates bash
COPY . go/src/github.com/unders/program # 2. copy your sorce code
RUN apk add go got mercurial \ # 3. add dependencies
&& cd /go/src/github.com/unders/program \
&& export GOPATH=/go \
&& go get -t \ # 4. resovel deps
resource/
   - html
      - layout.html
      - jobs/{index.html, new.html ...}
   - js/
   - css/
src/
- cmd
 - web/main.go
# SASS SECTION
BUILD_DIR := tmp/build
SASS_SRC_FILES := $(shell find app/sass -name "*.scss" | xargs)
SASS_FILES := $(SASS_SRC_FILES:%.scss=$(BUILD_DIR)/%.scss)
SASS_MAIN_FILE := $(BUILD_DIR)/app/sass/main.scss
SASS_TO_CSS_FILE := app/assets/stylesheets/main.css.erb
$(BUILD_DIR)/%.scss: %.scss
mkdir -p $(dir $@)
@unders
unders / Yosemite Installation Guide.md
Last active January 31, 2021 13:45
Yosemite Installation Guide

Run Software Update

Make sure everything is up to date.

Apple Command Line Tools

xcode-select --install

Manual installation

@unders
unders / formtastic.rb
Created February 10, 2014 09:14 — forked from rjz/formtastic.rb
# config/initializers/formtastic.rb
module FormtasticBootstrap
class FormBuilder < Formtastic::FormBuilder
# Allow "split-field" inputs such as name (first+last) or location (city+state).
# Block contents are wrapped in a ".controls" field set next to the specified
# +label+
#
# Usage:
#
@unders
unders / Run failures from history
Created October 11, 2013 08:59
Copy the failing test from the shell and then execute script/run_failures
$ script/run_failures
#!/bin/bash
pbpaste | awk '{ print $2 }' | xargs rspec
@unders
unders / tmux.sh
Created June 12, 2013 18:44 — forked from reborg/tmux.sh
Handy tmux.sh to add to your new Clojure project that creates a single window with one main Vim pane and a secondary small at the bottom which runs Midje autotest on top of a lein repl session.
export PROJECT_NAME=$1
export WORKING_DIR=/me/prj/$PROJECT_NAME
cd $WORKING_DIR;
# create the session
tmux start-server
tmux new-session -d -s $PROJECT_NAME -n work
# start vim in working dir
tmux select-window -t$PROJECT_NAME:1
@unders
unders / outer_join_with_arel.rb
Created November 1, 2012 13:29
Rails Outer Join with Arel
bt = Brand.arel_table
bft = BrandFollower.arel_table
user = User.first
outer_join = Arel::Nodes::OuterJoin.new(bft, Arel::Nodes::On.new(bft[:brand_id].eq(bt[:id])))
brand_follower = bft[:role].eq(:editor).and(bft[:follower_id].eq(user.id))
Brand.joins(outer_join).where(bt[:published].eq(true).or(brand_follower))