Skip to content

Instantly share code, notes, and snippets.

@c-vetter
c-vetter / npm-debug.log
Created May 24, 2016 14:49
npm install on babun
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files (x86)\\Nodist\\v-x64\\nodev6.2.0\\node.exe',
1 verbose cli 'C:\\Program Files (x86)\\Nodist\\bin\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '--verbose' ]
2 info using npm@3.5.2
3 info using node@v6.2.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
@c-vetter
c-vetter / gulp-watch-ng-annotate-lazypipe-fix.js
Created December 14, 2015 13:06
Using gulp-ng-annotate with lazypipe inside gulp-watch without triggering tasks still crashes even with plumber. This setup results in a continuous pipe setup resilient against syntax errors with very little overhead.
var gulp = require('gulp')
var gulpIf = require('gulp-if')
var gulpNgAnnotate = require('gulp-ng-annotate')
var gulpPlumber = require('gulp-plumber')
var gulpWatch = require('gulp-watch')
var lazypipe = require('lazypipe')
var processPipe
gulp.task('watch-annotate', watch)
@c-vetter
c-vetter / fisbas.rb
Created June 18, 2014 21:54
fisbas in 58 characters, just sayin' =)
1.upto(100){|i|p i%5>0?i%3>0?i:"fis":i%3>0?"bas":"fisbas"}
@c-vetter
c-vetter / model_steps.rb
Created April 10, 2011 17:11
Many models, one set of cucumber steps: BOOYAH!! also: machinist ftw
# make sure there are none
Given /^no (.+) exists$/ do |model_name|
model_class(model_name).destroy_all
end
# single model, one attribute of interest
Given /^a (?:(.+) )?(.+) with (.+) "(.+)" exists$/ do |blueprint_name, model_name, key, value|
model_class(model_name).make blueprint_name, key => value
end
@c-vetter
c-vetter / image_cycle.js
Last active September 25, 2015 11:08
simple click-through gallery, two variants, see comments and example pages -- add your own sample pics
/**
* The ImageCycle class cycles through a given set of images upon clicking the automatically generated buttons.
*
* @param Node
* This container node is expected to contain at least one 'img' tag.
* The first 'img' tag found will be used for displaying the cyled images.
* @param Array of Array of String [optional]
* Array of Arrays, each of which contains
* first the image path, then the title, optionally the caption.
*
@c-vetter
c-vetter / _setup.rb
Created April 1, 2011 09:25
Use these files to share blueprints between rspec and cucumber, centralize shams in one file, and store the blueprints in the blueprints directory in rails root. Don't forget to put machinist and ffaker in your Gemfile
require 'machinist/active_record'
require 'sham'
require 'ffaker'
# load all other .rb files in this directory
Dir[File.dirname(__FILE__)+'/*.rb'].each {|f| require f}
@c-vetter
c-vetter / request_launching.rb
Created April 1, 2011 09:13
for use with rspec-rails controller specs; avoids duplicate actions that basically differ only in the controller action. note the required spec_helper update
# streamlines request launching to remove duplication
#
# enables this setup:
# describe SomeController do
# describe :index do
# it 'works' do
# should do_something
# launch_request
# response.code.should eq('200')
# end