This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
textToRender = "Neato!" | |
fontSizeToRender = 1062 | |
fontSize(fontSizeToRender) | |
width, height = textSize(textToRender) | |
width = width * 1.4 | |
size(width, height) | |
# Centering. Needs to be fine tuned |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func doSomethingWithIntish(i int) { | |
// whatever | |
} | |
doSomethingWithInt(1) | |
// type time.Month int | |
doSomethingWithInt(time.January) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ARGV.join.match("--push-it-to-the-limit") || ENV['ALWAYS_BE_PUSHING_IT_TO_THE_LIMIT'] | |
puts "Pushing it to the limit." | |
system(%[osascript -e 'tell app "Rdio" to play source "t13182620"']) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
// mypackage "github.com/danott/mypackage" | |
mypackage "some-clever-service-name-for-versioning-go-programs.com/danott/mypackage/0.0.1" | |
) | |
func main() { | |
mypackage.ExportedFun() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module NullObject | |
extend ActiveSupport::Concern | |
included do | |
const_set("Null#{name}", Class.new) | |
end | |
module ClassMethods | |
def null | |
const_get("Null#{name}").new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# required on jsbin | |
Batman.config.usePushState = false | |
simpleStore = new Batman.Set() | |
simpleStore.add new Batman.Object({name: "Red"}) | |
simpleStore.add new Batman.Object({name: "Green"}) | |
simpleStore.add new Batman.Object({name: "Blue"}) | |
class App extends Batman.App | |
@root "colors#index" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class App.BehavesLikeEventBindingView extends Batman.View | |
fireOnSelfAndNearestAncestor: (event, args...) -> | |
@[event]?.apply(@, args) | |
if target = @superview?.targetForKeypath(event) | |
target[event].apply(target, args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name GitHub Labels | |
// @namespace http://danott.co/ | |
// @version 0.1 | |
// @description Automatically add and remove "+1", "+2", and "NOT READY!" labels bast on comment contents. Included on all of github because pushState. | |
// @include https://github.com/* | |
// @copyright 2014+, @danott | |
// ==/UserScript== | |
var getLabelName = function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In rails console. | |
dumb = Struct.new(:field_with_name) | |
[dumb.new(1), dumb.new(2), dumb.new(3)].sum(&:field_with_name) |
OlderNewer