Skip to content

Instantly share code, notes, and snippets.

View anonymous-gist.el
(global-set-key (kbd "<f1>") 'magit-status)
(define-key evil-normal-state-map "B" 'magit-checkout)
@mbriggs
mbriggs / README.md
Created Mar 25, 2014
Simple class abstraction in js
View README.md

Simple js class abstraction

Basically it is backbones self-propegating extend method, slightly hacked up to allow the definition of __name__. Defining this means that you will never end up seeing child when looking at your class in the dev tools. Also adds a define method for creating singletons.

View jsbin.damaq.css
canvas {
position: absolute;
top: 0;
width: 500px;
height: 500px;
cursor: move;
}
.canvas-container {
position: relative;
View gist:8826954
var gulp = require('gulp');
var gutil = require('gulp-util');
var sass = require('gulp-ruby-sass');
var watch = require('gulp-watch');
var plumber = require('gulp-plumber');
var traceur = require('gulp-traceur');
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var notify = require('gulp-notify');
View date-picker.js
function bindRange(scope, el, attrs){
var getFrom = $parse(attrs.pickFrom);
var setFrom = getFrom.assign;
var getTo = $parse(attrs.pickTo);
var setTo = getTo.assign;
var time = hasTime(attrs);
function updateField(){
var from = getFrom(scope);
var to = getTo(scope);
View gist:6969128

Thoughts on Angular

Overall, very impressed by how far the have come in the last year and a half or so. They have addressed probably the biggest issue I had with it last time I looked (how clunky it was to create even simple directives), the community is MUCH larger then it was, which has mitigated the second biggest issue (insufficient documentation)

The things I don't like thing is kind of big, but thats because its a combination of "dont like" with "don't understand" and "doing completely wrong", and at this point I don't really know enough about it to tell the difference :)

Things I Like

  • The view reaching into the JS means there is a class of wiring up / coordination code that doesn't need to exist.
View gist:6307107

I like OSX and I like Windows, have been a professional dev on both platforms. I totally understand where the post is coming from, but as a life long mac user, this is my perspective :)

I think the two big, major things the author missed are 1) OSX "power users" tend to be UNIX nerds, so doing things from the terminal is easy natural for them, and even if GUIs did exist they would probably go unused. While PowerShell is great, it is almost more of a scripting environment. UNIX is in my bones :) 2) When you buy a mac, expect to drop another 100-200$ on software to make it awesome (it is still reasonably easy to survive as a 1-2 man dev shop writing mac software as shareware, so there is a LOT of amazing shareware out there). By contrast, on windows, there is less software of that level of quality out there, but most of it is free. Good or bad, it is what it is, and has been that way for as long as I have had a mac (system 7 days)

  1. use http://www.alfredapp.com/ one of the best launchers out there for any O
View gist:6143061
(ns scrape-kuvva.core
(:require [scrape-kuvva.kuvva :as kuvva])
(:require [scrape-kuvva.files :as files]))
(def timeout 2000)
(defn sync
"Download any wallpaper that is
a) downloadable
b) not already downloaded"
View gist:5526196
# I think having the "functional" api to the rest of the system is the important part, if those functions happen to use objects, thats fine to me.
# in this case we are treating the "object" as a way to partially apply all the private functions to share the same arg
# IMO the only "danger" with using objects in this type of place is that you are going to hesitate if you want to add functions
# which do not use "all_events". In this case I think its probably fine, since "ReconcilesEvents" implies working on the full collection
class ReconcilesEvents
def self.tasks_that_have_not_ended(all_events)
new(all_events).unended_tasks
end
View gist:5389907

Sometimes, It's OK To Leave A Mess

Recently, we watched the excellent lunch and learn video from [Hashrocket][hashrocket], where [Sandi Metz][metz] [talks about test design][test-design]. While the whole video is worth watching, one thing that stood out to me was her term "Omega Mess".

Sometimes, there is something that you do based on experience, but it isn't formulated as a conscious thought. While very valuable, these understandings can become much more valuable when you are forced to explain them to someone else, because it stops being instinctual and becomes conscious.

The first time I heard someone refer to this concept was pairing with [Victor Savkin][savkin], where he referred to parts of the code as his "Dirty little secrets". While this is still my favourite name for the concept, I think Sandi's name of Omega Mess, meaning a mess that is at the end of everything, is far more apt, so I have used it ever since.

The Boyscout Rule

You can’t perform that action at this time.