Skip to content

Instantly share code, notes, and snippets.

View jumski's full-sized avatar
🐴
For the lack of a nail, throw new HorseshoeNailNotFoundException("no nails!");

Wojtek Majewski jumski

🐴
For the lack of a nail, throw new HorseshoeNailNotFoundException("no nails!");
View GitHub Profile
@jumski
jumski / README.md
Created January 29, 2016 11:46 — forked from phillbaker/README.md
A micro Gem for rspec controller spec default parameters.
@jumski
jumski / gist:0c90e26c24c5f735e1cc
Created November 30, 2015 17:38 — forked from soleblaze/gist:975bc2b0e5e69137fd08
/etc/X11/xorg.conf.d/50-synaptics.conf
Section "InputClass"
Identifier "touchpad"
Driver "synaptics"
MatchIsTouchpad "on"
# Enables Palm Detection to prevent bad clicks
# This seems to work on PS/2, but not on i2c
Option "PalmDetect" "1"
Option "PalmMinWidth" "8"
Option "PalmMinZ" "100"
# Enable clickpad support
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
(ns reagent-test.core
(:require [reagent.core :as reagent :refer [atom]]
[datascript :as d]
[cljs-uuid-utils :as uuid]))
(enable-console-print!)
(defn bind
([conn q]
(bind conn q (atom nil)))
function! SpecCommandForCurrentFile(alternate_letter)
let basename = expand("%:t:r")
exec ":".a:alternate_letter."spec ".basename."!"
endfunction
cmap A! call SpecCommandForCurrentFile("R")<cr>
cmap V! call SpecCommandForCurrentFile("V")<cr>
cmap S! call SpecCommandForCurrentFile("S")<cr>
cmap T! call SpecCommandForCurrentFile("T")<cr>
@jumski
jumski / README.md
Last active August 29, 2015 14:07
Capistrano crotab tasks for multiple projects deployed from same user

Capistrano + crontab + multiple projects sharing a linux user

  1. put crontab.cap into lib/capistrano/tasks/crontab.cap
  2. create your crontab file (you can use ERB) and put it somewhere
  3. set crontab_template to point to your crontab file, eg:
set :crontab_template, File.expand_path('./crontab.erb', File.dirname(__FILE__))
@jumski
jumski / curspec
Created September 10, 2014 12:27
VIM + Rspec : run spec for last cursor save position
#!/bin/bash
[ -S .zeus.sock ] && PREFIX=zeus
COMMAND="$PREFIX rspec `cat .cursor_last_position`"
VERBOSE=false
echo $COMMAND
$COMMAND
@jumski
jumski / hax
Created February 19, 2014 15:26
Finished in 2.8 seconds
Finished in 3.15 seconds
Finished in 3.18 seconds
Finished in 3.21 seconds
Finished in 3.31 seconds
Finished in 3.34 seconds
Finished in 3.39 seconds
Finished in 3.41 seconds
Finished in 3.57 seconds
Finished in 3.59 seconds
@jumski
jumski / invalid_json_spec.rb
Last active August 29, 2015 13:56
Sending invalid json in request specs
it 'responds properly when invalid json was sent' do
send method, path, '{invalid_json]',
'CONTENT_TYPE' => 'application/json',
'ACCEPT' => 'application/json'
expect(response.code.to_i).to eq 400
expect(JSON.parse(response.body)).to equal({'message' => 'Problems parsing JSON'})
end
angular.module('stateMock',[]);
angular.module('stateMock').service("$state", function($q){
this.expectedTransitions = [];
this.transitionTo = function(stateName){
if(this.expectedTransitions.length > 0){
var expectedState = this.expectedTransitions.shift();
if(expectedState !== stateName){
throw Error("Expected transition to state: " + expectedState + " but transitioned to " + stateName );
}
}else{