Skip to content

Instantly share code, notes, and snippets.

View Kerrick's full-sized avatar

Kerrick Long Kerrick

View GitHub Profile
@Kerrick
Kerrick / application.controller.js
Created March 23, 2016 18:27
Dirty Property Test Case
import Ember from 'ember';
export default Ember.Controller.extend({
});
@Kerrick
Kerrick / controllers.application.js
Created August 6, 2015 19:59
Array Computed without arrayComputed?
import Ember from 'ember';
const { computed, get, set } = Ember;
export default Ember.Controller.extend({
appName:'Ember Twiddle',
parts: computed('appName', {
get() {
return get(this, 'appName').split(' ');
},
@Kerrick
Kerrick / gist:10741833
Created April 15, 2014 15:29
Keybase proof

Keybase proof

I hereby claim:

  • I am Kerrick on github.
  • I am kerrick (https://keybase.io/kerrick) on keybase.
  • I have a public key whose fingerprint is 2CA6 BC69 0DFF 54BF DA9B 4F49 08DD E043 06DF CD97

To claim this, I am signing this object:

@Kerrick
Kerrick / computed-property.coffee
Created March 21, 2014 14:58
Ember.js CoffeeScript Computed Properties
fullName: Ember.computed 'firstName', 'lastName', ->
"#{@get('firstName')} #{@get('lastName')}"
###
Tends to be less awkward than:
fullName: (->
"#{@get('firstName')} #{@get('lastName')}"
).property('firstName', 'lastName')
###
@Kerrick
Kerrick / gotta-clone-them-all.rb
Created March 19, 2013 01:19
gotta-clone-them-all, to clone all the github repositories of a user
#!/usr/bin/env ruby
# gotta-clone-them-all, to clone all the github repositories of a user
# Copyright (C) 2013 Kerrick Long
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@Kerrick
Kerrick / git-reauthor.sh
Created February 12, 2013 06:33
If you forgot to configure git with your email and username, you _may_ want to use the following shell script, customizing the email it searches for and the name and email it replaces them with to what you see in git log. Be careful! Heed the warnings from the source: https://help.github.com/articles/changing-author-info
#!/bin/sh
git filter-branch --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "kerrick@dirk-tooth.(none)" ]
@Kerrick
Kerrick / perl via bash
Created February 12, 2013 06:14
Convert ruby 1.8 style hashes (hashrockets) into ruby 1.9 style hashes (json-style) Source: http://robots.thoughtbot.com/post/17450269990/convert-ruby-1-8-to-1-9-hash-syntax
perl -pi -e 's/:([\w\d_]+)(\s*)=>/\1:/g' path/to/file.rb
@Kerrick
Kerrick / gist:2839458
Created May 30, 2012 23:01
Override how rails computes asset tags to work in multi-server deployments via git commits
# Override how rails computes asset tags to work in multi-server deployments via git commits
module ActionView
module Helpers
module AssetTagHelper
def rails_asset_id(source)
if asset_id = ENV["RAILS_ASSET_ID"]
asset_id
else
if @@cache_asset_timestamps && (asset_id = @@asset_timestamps_cache[source])
@Kerrick
Kerrick / gist:2716568
Created May 17, 2012 05:08
HOWTO install Sublime Text 2 in Debian Squeeze
# Download Sublime Text 2 from http://www.sublimetext.com/2
# If you aren't root, sudo su
tar -xvjf Sublime\ Text\ 2*.tar.bz2
mv Sublime\ Text\ 2/ /opt/sublime-text-2/
ln -s /opt/sublime-text-2 /usr/local/sublime-text-2
ln -s /usr/local/sublime-text-2/sublime_text /usr/local/bin/sublime_text
rm Sublime\ Text\ 2*.tar.bz2
# Sublime Text 2 can now be run as normal user with command "sublime_text"
@Kerrick
Kerrick / gist:2715717
Created May 17, 2012 02:18
Sublime Text 2 settings for a happier life
{
"auto_indent": true,
"caret_style": "phase",
"color_scheme": "Packages/Color Scheme - Default/IR_Black.tmTheme",
"default_line_ending": "unix",
"draw_minimap_border": true,
"ensure_newline_at_eof_on_save": true,
"font_face": "Bitstream Vera Sans Mono",
"font_options":
[