Skip to content

Instantly share code, notes, and snippets.

@brumm
brumm / gist:3437594
Created August 23, 2012 15:10
sublime shortcuts
# expand selection to word, create new selection
cmd + d
# skip over a match
cmd + k, d
# expand selection to all matches
cmd + ctrl + g
# -------------------------
# application_controller.rb
# -------------------------
class ApplicationController < ActionController::Base
before_filter :setup_gon
def setup_gon
Gon.global.controller = controller_name
Gon.global.action = action_name
@brumm
brumm / flare-imports.json
Created December 5, 2012 12:02 — forked from mbostock/.block
Munky Imports
[{
"name": "Munky.Views.ArticleFull",
"imports": ["Munky.Views.Category", "Munky.Models.Section", "Munky.Collections.Articles", "Munky.Settings.App", "Munky.Settings.Metrics", "Munky.Support.Time", "Munky.Support.Stocks", "Munky.FinApi"]
}, {
"name": "Munky.Views.Video",
"imports": ["Munky.Views.ArticleFull", "Munky.Settings.Metrics", "Munky.Support.Time"]
}, {
"name": "Munky.Views.Homepage",
"imports": ["Munky.Models.Section", "Munky.Collections.Articles", "Munky.Views.BreakingNews", "Munky.Views.Stock", "Munky.Views.Top", "Munky.Views.Stage", "Munky.Views.Focus", "Munky.Views.Special", "Munky.Views.Category", "Munky.Views.VideoSection", "Munky.Views.PhotoshowSection", "Munky.Views.Spinner", "Munky.Collections.Videos", "Munky.Collections.StockPrices", "Munky.Settings.App", "Munky.Settings.Spinner.Messages.Homepage", "Munky.Support.Browser"]
}, {
(function bankicker() {
var all_users = User.all();
// the first character of a username is being replaced
// but not used/written back to the dom??
// var chat = $('.uc');
// chat.each(function() {
// var user = $(this).find('.cun').text();
// user = user.replace(/[^a-zA-Z]/g, '');
// });
for (var i = 0; i < all_users.length; i++) {
zinc|master ⇒ gs
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: Gemfile
# modified: Gemfile.lock
# modified: app/assets/stylesheets/definitions.sass
# modified: app/assets/stylesheets/modules/_buttons.sass
@brumm
brumm / gist:7536211
Created November 18, 2013 22:03
Effortlessly log values without having to wrap your code in console.log() calls, by logging the value, and returning it, allowing for chaining
Object.defineProperty(Object.prototype, '_log_', {
get: function() {
"use strict";
console.log(this);
return this;
},
enumerable: false
});
class FilterCollection extends Backbone.Collection
set: (models, options) ->
models = if _.isArray models
models
else
[models]
[models, filtered]= _.partition models, @filter
super(models, _.extend({merge: false}, options, {add: true, remove: false }))
super(filtered, _.extend({merge: false}, options, {add: true, remove: false, silent: true}))
init.coffee
Mole.start nwWindow: window.nwWindow
app.coffee
setup resources
start modules (Header, Calendar)
start module Authentication
calendar.coffee
initialize resources with either cached api response or empty objects
@brumm
brumm / food.coffee
Last active August 29, 2015 14:05 — forked from bumi/food.coffee
# Description:
# hubot suggests a place to go for food
#
# Dependencies:
# node-foursquare-venues
#
# Configuration:
# configure your foursquare client id and secret and your location
#
# Commands:
Process: Affinity Designer [874]
Path: /Applications/Affinity Designer.app/Contents/MacOS/Affinity Designer
Identifier: com.seriflabs.affinitydesigner
Version: 1.0.19046 (1.0.19046)
Code Type: X86-64 (Native)
Parent Process: launchd [162]
Responsible: Affinity Designer [874]
User ID: 501
Date/Time: 2014-09-22 13:30:28.799 +0200