I hereby claim:
- I am ryands on github.
- I am ryands (https://keybase.io/ryands) on keybase.
- I have a public key whose fingerprint is D0CA AAC9 FC0A 7B41 829B 31B0 3369 F0BD BB2C E1EB
To claim this, I am signing this object:
/* Module pattern in javascript | |
* Not using RequireJS/ES6/Node/... | |
*/ | |
var MyModule = (function () { | |
function SubClass() { | |
// constructor | |
} | |
SubClass.prototype.someMethod = function() { |
Chrome 36.0.1985.67 on OS X 10.9.3 | |
Sit back and relax, this may take a while. | |
`_(...)` with a number: | |
lodash.min x 148,659,845 ops/sec ±1.16% (83 runs sampled) | |
underscore-min x 21,250,737 ops/sec ±0.71% (89 runs sampled) | |
lodash.min is 596% faster. | |
`_(...)` with an array: |
I hereby claim:
To claim this, I am signing this object:
@Override | |
protected void onResume() { | |
super.onResume(); | |
loadImageWhenReady(imageView, mPayload); | |
} | |
private static void loadImageWhenReady(final ImageView v, final String url) { | |
v.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { | |
@Override | |
public void onGlobalLayout() { |
var addition = function(a, b, callback) { | |
var result = a + b; | |
if (callback != null) { | |
callback(result); | |
} | |
}; | |
addition(2, 3, function(result) { | |
alert("The sum is " + result + "!"); | |
}); |
public class Builder { | |
public static void main(String... args) { | |
DogeBuilder builder = new DogeBuilder(); | |
builder.setSo("design") | |
.setSuch("pattern") | |
.setVery("software engineering"); | |
System.out.println(builder.build()); | |
} |
class Hash | |
# This will favor :symbol keys over string keys | |
def method_missing (method, *args) | |
if has_key? method.to_sym | |
self[method.to_sym] | |
elsif has_key? method.to_s | |
self[method.to_s] | |
else | |
super | |
end |
package org.ryands.android; | |
import android.app.Activity; | |
import android.os.Bundle; | |
/** | |
* A proper splash screen for android. | |
*/ | |
public class SplashActivity extends Activity { | |
@Override |
#!/usr/bin/env python | |
# usage: ./logconcat.py output.log [list, of, input, files] | |
# Eventually I'll put all log entries in a db for more fun. | |
from datetime import datetime | |
class LogEntry(): | |
def __init__(self, date, entry): |
#!/usr/bin/env perl -w | |
use strict; | |
print "<style name=\"" . shift . "\">\n"; | |
while (<>) { | |
print " <item name=\"$1\">$2</item>\n" if ($_ =~ /\s*([^=]+)=\"([^\"]+)\"/i); | |
} | |
print "</style>\n"; |