Skip to content

Instantly share code, notes, and snippets.

View BiggerNoise's full-sized avatar

Andy Davis BiggerNoise

View GitHub Profile
[
{ "keys": ["super+d"], "command": "duplicate_line" },
{ "keys": ["ctrl+shift+k"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
{ "keys": ["super+shift+d"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
{ "keys": ["super+j"], "command": "join_lines" },
{ "keys": ["ctrl+shift+j"], "command": "join_lines" },
{ "keys": ["super+\\"], "command": "reveal_in_side_bar" },
{ "keys": ["super+alt+l"], "command": "reindent" },
// Select text between brackets
{
@BiggerNoise
BiggerNoise / command.rb
Created April 1, 2014 02:13
Little add in module to make parameter parsing a little easier in Virtus classes.
class Command
include ActiveModel::Validations
include ActiveRecord::Serialization
include Virtus
include VirtusParameters
def initialize(params = {})
super
parse_params params
end
@BiggerNoise
BiggerNoise / .bash_profile
Created April 8, 2015 16:40
Some useful shell commands and aliases when working with godep
# simple commands to alter the GOPATH for longer than a single command
alias guse='GOPATH=$(godep path):$HOME/dev/go'
alias greset='GOPATH=$HOME/dev/go'
@BiggerNoise
BiggerNoise / assign_case_command.rb
Created March 3, 2014 21:10
Command Pattern at work
class AssignCaseCommand < Command
attribute :case, Case
attribute :owner, User
attribute :created_by, User
attribute :comments, String
attribute :distribute_at, DateTime
attribute :distribute_rule_name, String
attribute :require_initial, Boolean
@BiggerNoise
BiggerNoise / app.js
Created September 1, 2012 21:19
A better javascript namespace/module pattern
app = (function () {
var Namespace = function () {
}
var Module = function () {
}
Namespace.prototype.createModule = function () {
var m = new Module;
if(arguments.length > 0)
@BiggerNoise
BiggerNoise / revalingModule.js
Created September 1, 2012 21:48
Basic Revealing Module
mything = (function(){
var Foo, Bar, binky, boo;
binky = function() {
// does something useful
};
boo = function() {
// does something amazing
};
@BiggerNoise
BiggerNoise / ns_module1.js
Created September 2, 2012 03:56
Namespace & Module Use I
company = app.namespace(company);
company.master= app.namespace(company.master)
@BiggerNoise
BiggerNoise / usermodule.js
Created September 2, 2012 04:00
Namespace/Module Use 2
company.master.users = company.master.createModule( function(){
var RevealedClass, hiddenFunction
RevealedClass = function(){
// stuff
};
hiddenFunction = function(){};
// this is the private area of the module
this.privateThing = 42;
@BiggerNoise
BiggerNoise / user_exposed.js
Created September 2, 2012 04:00
Namespace/Module Use 3
company.master.users = company.master.users.extend(function(){
// use it
var myLocalThing = this.privateThing,
ExposedClass = function(){
};
return {
Exposed:ExposedClass
}
});
@BiggerNoise
BiggerNoise / additional_parameters.js
Created September 2, 2012 04:01
Namespace/Module Use 4
company.master.users = company.master.users.extend(function($, log){
}, $, loggingSystem);