Skip to content

Instantly share code, notes, and snippets.

View darkone23's full-sized avatar
💭
💾☠🕸

0/∞ darkone23

💭
💾☠🕸
View GitHub Profile
@darkone23
darkone23 / myApp.js
Last active August 29, 2015 14:20 — forked from cthecheese/myApp.js
var myApp = angular.module("myApp", []);
myApp.controller("contactsController", function($scope, contactsFactory){
$scope.contacts = contactsFactory.getContacts();
$scope.add = function(newContact){
contactsFactory.add(newContact);
$scope.newContact = contactsFactory.cleanContact();
$scope.contacts = contactsFactory.getContacts();
}

Confusion around om functionality

(defn static-data []
  (for [row (range 10)]
    {:a "some" :b "fake" :c "data"}))

(def app-state (atom {:items (static-data)}))

;;; components
render: function(){
this.collection.each(console.log);
},
@darkone23
darkone23 / utilities.js
Last active December 9, 2015 19:18 — forked from oojacoboo/utilities.js
using a closure so middleware no longer requires currying
$.fn.setupFilterInput = function (events) {
var $input = $(this),
handlers = {
// use these to provide default but overwriteable functionality
focus: function () {},
blur: function () {},
keyUp: function () {},
click: function () {}
},
middleware = {
@darkone23
darkone23 / HelloIsolate.dart
Created November 20, 2012 03:39 — forked from adam-singer/HelloIsolate.dart
Hello world using new dart:isolate
#!/usr/bin/env dart
#import('dart:isolate');
isolateCode() {
isolate.port.receive((msg, reply) => reply.send("re: $msg"));
}
void main() {
isolate.SendPort sendPort = isolate.spawnFunction(isolateCode);
@darkone23
darkone23 / minimalist-classes.js
Created December 20, 2011 06:46 — forked from BrendanEich/minimalist-classes.js
less minimalism, richer leather
// A response to jashkenas's fine proposal for minimalist JavaScript classes.
// Harmony always stipulated classes as sugar, so indeed we are keeping current
// JavaScript prototype semantics, and classes would only add a syntactic form
// that can desugar to ES5. This is mostly the same assumption that Jeremy
// chose, but I've stipulated ES5 and used a few accepted ES.next extensions.
// Where I part company is on reusing the object literal. It is not the syntax
// most classy programmers expect, coming from other languages. It has annoying
// and alien overhead, namely colons and commas. For JS community members who