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
# dynamically injecting into the multiple inheritance chain, like ruby's modules. | |
# can we stop fighting already? | |
class Foo(object): | |
pass | |
class Bar(Foo): | |
pass | |
class Baz(object): |
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
(function(){ | |
_textarea=document.createElement('TEXTAREA'); | |
_textarea.setAttribute('class', 'crashtest'); | |
document.getElementsByTagName('body')[0].appendChild(_textarea); | |
_textarea.focus(); | |
_evt = document.createEvent("TextEvent"); | |
_evt.initTextEvent("textInput", true, true, window, 'file:///'); | |
_textarea.dispatchEvent(_evt); | |
} | |
)() |
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
// pattern: *play.google.com/music* | |
setTimeout(removeTopBar, 100); | |
setTimeout(removeUser, 100); | |
var $ = function () { | |
return document.getElementById.apply(document, arguments); | |
} | |
function removeTopBar() { |
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
0000000004071c1a t +[GLFWContentView initialize] | |
000000000407276b t -[GLFWApplication sendEvent:] | |
0000000004071c10 t -[GLFWApplicationDelegate applicationDidChangeScreenParameters:] | |
0000000004071b98 t -[GLFWApplicationDelegate applicationDidHide:] | |
0000000004071bc4 t -[GLFWApplicationDelegate applicationDidUnhide:] | |
0000000004071b6c t -[GLFWApplicationDelegate applicationShouldTerminate:] | |
0000000004071dbc t -[GLFWContentView acceptsFirstResponder] | |
0000000004071db1 t -[GLFWContentView canBecomeKeyView] | |
0000000004071d5c t -[GLFWContentView dealloc] | |
00000000040724b9 t -[GLFWContentView flagsChanged:] |
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
# config/initializers/nokogiri_builders.rb | |
# Using Nokogiri::XML::Builder in lieu of stock pure ruby Builder for Rails builder templates | |
# unrelated, but you might want this too to enable parsing | |
# XML params with Nokogiri | |
#ActiveSupport::XmlMini.backend = 'Nokogiri' | |
module Nokogiri | |
module XML | |
class Builder |
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
~/Library/Application Support/FEZ/Settings | |
--8<-- Default (Xbox 360) | |
gamepadMapping Jump=1 GrabThrow=0 CancelTalk=2 OpenMap=8 OpenInventory=3 MapZoomIn=5 MapZoomOut=4 Pause=9 RotateLeft=6 RotateRight=7 FpViewToggle=10 ClampLook=11 | |
--8<-- Sony PS3 DualShock3 / Logitech RumblePad 2 | |
gamepadMapping Jump=14 GrabThrow=15 CancelTalk=13 OpenMap=0 OpenInventory=12 MapZoomIn=9 MapZoomOut=8 Pause=3 RotateLeft=10 RotateRight=11 FpViewToggle=1 ClampLook=2 | |
--8<-- |
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
# http://moonbase.rydia.net/mental/writings/programming/monads-in-ruby/01identity | |
# Identity monad | |
class Identity | |
def initialize(value) | |
@value = value | |
end | |
# unit operation: Haskell 'return' | |
def self.munit(value) |
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
# Ubuntu has a stupid policy of not cleaning up boots because they deem | |
# unknowable whether a kernel is valid or not (even if booted). Combined with | |
# the default Ubuntu setup that creates a ridiculously small /boot that is | |
# bound to be filled in a few months worth of updates, you have a recipe for a | |
# failure during upgrade, leading to being unable to update or remove anything | |
# and having to mess with apt and dpkg innards by hand. | |
# This may work for Debian too. | |
# This one liner keeps /boot fresh and clean by removing the currently | |
# running kernel version as well as the latest one (which may not be |
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
#!/bin/bash | |
tmp=$(mktemp -d) | |
pushd "$tmp" | |
iso=/Users/lloeki/Downloads/archlinux-2015.08.01-dual.iso | |
echo "fixing disk" | |
dd if=/dev/zero bs=2k count=1 of=tmp.iso | |
dd if=$iso bs=2k skip=1 >> tmp.iso | |
echo "mounting disk" |
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
// Electron's quick start sample, naively ported to Go | |
// https://github.com/atom/electron/blob/master/docs/tutorial/quick-start.md | |
// | |
// go get -u gopherjs | |
// gopherjs build main.go | |
// electron $(pwd) | |
package main | |
import ( |