Skip to content

Instantly share code, notes, and snippets.

@crabbits
crabbits / steps.md
Last active December 6, 2018 23:50
Create SpinaCMS plugin using rspec-rails
@crabbits
crabbits / gist:c306e548a674a18e1e88
Created October 29, 2014 00:08
Ember data clone record
DS.Model.reopen
clone: (overrides) ->
model = this
attrs = model.toJSON()
klass = model.constructor
root = Em.String.decamelize(klass.toString().split(".")[1])
@eachRelationship (key, relationship) ->
if relationship.kind is "belongsTo"
attrs[key] = model.get(key)
@crabbits
crabbits / gist:47cfe198737a2fc9df4d
Created August 25, 2014 06:15
Pry & Debugger Call Check
namespace :ci_smoke do
desc "Checks project to ensure there are no calls to pry or debugger"
task :check_pry_debugger do
excluded_dirs = %w{ .git tasks tmp vendor }
excluded_files = %w{ Gemfile *.lock }
strings = %w{ binding.pry debugger }
strings.each do |s|
puts("Checking for calls to #{s}")
@crabbits
crabbits / DroidForm.java
Last active February 25, 2016 15:10
Android form helper (WIP)
/* DroidForm.java */
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import android.app.Activity;
import android.content.Context;
import android.util.Log;