Skip to content

Instantly share code, notes, and snippets.

View kamal's full-sized avatar

Kamal Fariz Mahyuddin kamal

View GitHub Profile
addEventListener("fetch", event => {
event.respondWith(handleRequest(event.request));
});
/**
* Multiplex requests to a fixed list of destinations.
*
* It is intentional that we only support rewriting the incoming request URL to
* that of the destination. Everything else on the request is untouched.
*
@kamal
kamal / gist:67e7c87d03ea2fbe92fdb3c718124782
Created August 6, 2016 01:58
Rails 5 upgrade commit messages
* makes bundle update succeed
* fixes config.serve_static_files deprecation
* fixes config.static_cache_control deprecation
* fixes raise_in_transactional_callbacks deprecation
* replaces config.assets.precompile with manifest.js
Error: EEXIST, file already exists '/Users/kamal/src/garaje/tmp/caching-writer-dest-dir_dlQOxl.tmp'━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
at Error (native)
at Object.fs.symlinkSync (fs.js:852:18)
at symlink (/Users/kamal/src/garaje/node_modules/ember-cli/node_modules/symlink-or-copy/index.js:82:14)
at Function.symlinkOrCopySync (/Users/kamal/src/garaje/node_modules/ember-cli/node_modules/symlink-or-copy/index.js:58:5)
at /Users/kamal/src/garaje/node_modules/ember-cli/node_modules/broccoli-sourcemap-concat/node_modules/broccoli-caching-writer/index.js:103:21
at lib$rsvp$$internal$$tryCatch (/Users/kamal/src/garaje/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:489:16)
at lib$rsvp$$internal$$invokeCallback (/Users/kamal/src/garaje/node_modules/ember-cli/node_modules/promise-map-series/node_modules/rsvp/dist/rsvp.js:501:17)
at lib$rsvp$$internal$$publish (/Users/kamal/src/

this is a test

another line

Keybase proof

I hereby claim:

  • I am kamal on github.
  • I am kamal (https://keybase.io/kamal) on keybase.
  • I have a public key whose fingerprint is 3553 A13F 4109 E7FA 0F99 BA7B A82F 6EE2 B52B 9135

To claim this, I am signing this object:

{
"continents": {
"Africa": [
"Africa"
],
"Antarctica": [
"Antarctica"
],
"Asia": [
"Asia"
test("modifying a hasMany record should make parent dirty", function() {
expect(2);
var Author = Ember.Model.extend({
id: Ember.attr(),
name: Ember.attr()
}),
Post = Ember.Model.extend({
id: Ember.attr(),
authors: Ember.hasMany(Author, {key: 'author_ids'})
Ember.run(function() {
author.load(100, {id: 100, name: 'bob'});
post.load(1, {id: 1, author_ids: [100]});
});
Ember.run(function() {
author.set('name', 'billy');
});
@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();
});
@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('/')