Skip to content

Instantly share code, notes, and snippets.

View jrolfs's full-sized avatar

Jamie Rolfs jrolfs

View GitHub Profile
describe 'Mixins SortableCollectionView', ->
#
# Sample Classes
class ItemView extends Backbone.Marionette.ItemView
template: ''
itemViewContainer: '.item-view-container'
@jrolfs
jrolfs / chat.js
Last active August 29, 2015 13:57
var $messages = $(".messages")
function myFetchFunction() {
$.getJSON("https://api.parse.com/1/classes/chats?order=-createdAt", function (data) {
// Clear any old output from DOM
$messages.empty();
// Iterate through response and append each result as a list item
$.each(data, function (index, result){
@jrolfs
jrolfs / github-is.sh
Last active August 29, 2015 13:57
Shell script for monitoring GitHub status (with emoji cats).
#!/bin/sh
while :
do
api_response=$(http https://status.github.com/api/status.json)
gh_status=$(echo "$api_response" | jq ".status" | sed "s/\"//g")
gh_at=$(date -v $(date +%z)H -jf "%Y-%m-%dT%H:%M:%SZ" $(echo "$api_response" | jq ".last_updated" | sed "s/\"//g"))
case $gh_status in
"good")
==> ENV
HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
MAKEFLAGS: -j8
CMAKE_PREFIX_PATH: /usr/local
CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Library/ENV/pkgconfig/10.8
ACLOCAL_PATH: /usr/local/share/aclocal
PATH: /usr/local/Library/ENV/4.3:/usr/local/opt/cmake/bin:/usr/bin:/bin:/usr/sbin:/sbin
$ brew install -v synergy 1 ↵
==> Downloading http://fossfiles.com/synergy/synergy-1.4.17-r2055-Source.tar.gz
Already downloaded: /Library/Caches/Homebrew/synergy-1.4.17.tar.gz
==> Verifying synergy-1.4.17.tar.gz checksum
tar xf /Library/Caches/Homebrew/synergy-1.4.17.tar.gz
==> Patching
patching file src/lib/platform/OSXDragView.m
==> unzip ext/cryptopp562.zip -d ext/cryptopp562
Archive: ext/cryptopp562.zip
inflating: ext/cryptopp562/3way.cpp
@jrolfs
jrolfs / j+j.md
Last active August 29, 2015 14:03
J + J in S + F
function switchMe(thing) {
switch(true) {
case _.isString(thing):
return 'string';
case _.isArray(thing):
return thing.join(' ');
case _.isObject(thing):
return 'O B J';
default:
return 'bro';
orders = Order.joins(:user)
.where('users.created_at > ?', start_date)
.select(order_columns)
.where('orders.created_at > ?', start_date) # <--- It's gotta be the join
require 'bundler'
require 'fileutils'
require 'sprockets/standalone'
require 'rake/hooks'
Bundler.require
GEM_ASSETS = %w(
my-gem-asset
my-other-gem-asset
@jrolfs
jrolfs / redlints.xml
Created August 2, 2012 21:43
SublimeLinter red inline highlights
<dict>
<key>name</key>
<string>SublimeLinter Error Outline</string>
<key>scope</key>
<string>sublimelinter.outline.illegal</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#440000</string>
<key>foreground</key>