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
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{
@jumski
jumski / tmp.txt
Created September 23, 2013 20:10
android_hover.png PNG 37x43
android.jpg JPEG 65x65
angular.jpg JPEG 65x65
angularjs_hover.png PNG 41x43
apple_hover.png PNG 35x42
apple.jpg JPEG 65x65
backbone.jpg JPEG 65x65
backbonejs_hover.png PNG 33x41
elasticsearch.jpg JPEG 65x65
html5_hover.png PNG 38x43
@jumski
jumski / tmp
Created September 19, 2013 11:42
tmp
www-deploy@mentorella:/var/www/sentenzeitalia2_backend_staging$ grep ruby /etc/nginx/conf.d/passenger.conf
#passenger_ruby /usr/local/rvm/wrappers/ruby-1.9.2-p318@rails32/ruby;
passenger_ruby /usr/bin/ruby1.9.3;
www-deploy@mentorella:/var/www/sentenzeitalia2_backend_staging$ ruby1.9.3 --version
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
www-deploy@mentorella:/var/www/sentenzeitalia2_backend_staging$ which bundle
/usr/local/rvm/gems/ruby-1.9.3-p429@global/bin/bundle