Skip to content

Instantly share code, notes, and snippets.

View kamal's full-sized avatar

Kamal Fariz Mahyuddin kamal

View GitHub Profile
function Foo() {
}
Foo.prototype = {
override_me: function() {
alert('bar');
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>maccman.juggernaut</string>
<key>ProgramArguments</key>
<array>
@kamal
kamal / gist:835811
Created February 20, 2011 07:53 — forked from sssionggg/gist:835808
* Start Small, Stay Small: A Developer's Guide to Launching a Startup
* The Art of Game Design: A book of lenses
* Do More Faster: TechStars Lessons to Accelerate Your Startup
* The No Asshole Rule: Building a Civilized Workplace and Surviving One That Isn't
* Free: The Future of a Radical Price
* Founders at Work: Stories of Startups' Early Days
* Hackers and Painters: Big Ideas from the Computer Age
* The Pragmatic Programmer: From Journeyman to Master
@kamal
kamal / baby_talk.rb
Created April 29, 2011 14:02 — forked from stympy/subscription_plan.rb
Extending a model in a Rails 3 (pre-3.1) engine
module BabyTalk
class Engine < Rails::Engine
config.to_prepare do
User.class_eval do
has_many :participations, :foreign_key => "participant_id"
has_many :rooms, :through => :participations
end
end
end
end
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Parse Error
at Client.onData [as ondata] (http.js:1464:27)
at Client._onReadable (net.js:677:27)
at IOWatcher.onReadable [as callback] (net.js:177:10)
(function(exports) {
window.DS = SC.Namespace.create();
})({});
(function(exports) {
DS.Adapter = SC.Object.extend({
commit: function(store, commitDetails) {
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script src="http://cloud.github.com/downloads/emberjs/ember.js/ember-0.9.3.min.js"></script>
<script src="https://raw.github.com/gist/1531917/b8fd56c2033a1629d6497eb6784177cb4658d930/ember-data.js"></script>
<script type="text/javascript">
$(document).ready(function() {
window.App = Ember.Application.create();
App.store = DS.Store.create({
adapter: DS.Adapter.create()
git log --pretty=format:'%ae: %s' | ack "test|bomb|fail|conflict" | awk '{h[$1]++}END{for(i in h){print h[i],i|"sort -rn|head -20"}}' | awk '!max{max=$1;}{r="";i=s=60*$1/max;while(i-->0)r=r"#";printf "%35s %5d %s %s",$2,$1,r,"\n";}'
@kamal
kamal / gist:6026760
Created July 18, 2013 04:42
within helper for ember-test
Ember.Test.registerHelper('within', function(app, withinContext, callback){
var originalFind = window.find;
window.find = function(selector, context) {
return originalFind.call(app, selector, withinContext);
};
callback.call();
window.find = originalFind;
});
visit('/')
@kamal
kamal / gist:6072267
Last active December 20, 2015 04:39
Ember.Test.registerHelper('select', function(app, selector, context, label) {
if (typeof label === 'undefined') {
label = context;
context = null;
}
var $select = findWithAssert(selector, context);
var $option = findWithAssert('option:contains(' + label + ')', $select);
Ember.run(function(){
$select.val($option.prop('value')).change();
});