Talks briefly about Kay's Vivarium Project... TODO: find out more
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
var dbRef = new Firebase("https://YOUR-FIREBASE.firebaseio.com/"); | |
export default Ember.Controller.extend({ | |
/** | |
@property currentUser | |
@type {User} | |
@default null | |
*/ | |
currentUser: null, |
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
;; Schema | |
{:db/doc "Find or create tag atomically." | |
:db/ident :find-or-create-tag | |
:db/fn #db/fn {:lang "clojure" | |
:params [mydb n key value] | |
:code (when (empty? (d/q '[:find ?e :in $ ?ns ?key ?value :where | |
[?e :meta/tag-namespace ?n] | |
[?e :meta/tag-key ?key] | |
[?e :meta/tag-value ?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
; Input via stdin | |
; Formatted as described in reddit.com/r/dailyprogrammer/comments/20cydp/14042014_challenge_152_hard_minimum_spanning_tree/ | |
(defn with-index [coll] | |
(map-indexed vector coll)) | |
(defn get-adjacency [] | |
(with-index (map with-index | |
(repeatedly (read-string (read-line)) | |
#(map read-string (clojure.string/split (read-line) #", *")))))) |
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
/* | |
Add `nouns` as http mocks and use in a local db, available via API in develoment | |
* Install the adapter `npm install rethinkdb_adapter --save-dev` | |
* Install RethinkDB, see https://github.com/pixelhandler/ember-slide-deck/blob/master/bin/install_rethinkdb.sh | |
* Start db `rethinkdb` | |
* Setup Db and Table, see https://github.com/pixelhandler/ember-slide-deck/blob/master/bin/setup_db.js | |
* Generate a mock `ember g http-mock nouns` and edit your mock to use the db, see code below for 'slides' | |
* Set your application adapter to use `namespace: 'api'` | |
* In our routes use Ember Data in your model hook |
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
Topic | |
- NoSQLite | |
- Consider 3 useful things: | |
- SQLite - SQLite is itself a great datastore because it is a | |
fast and powerful SQL database in one file and is widely | |
deployed and supported. | |
- JSON - JSON is a simple and cruft free way to describe and | |
transport objects. That is why programmers love it. There is | |
good support for it in virtually every language. | |
- HTTP - HTTP allows things to connect and talk to each other. |
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
// Using Knockout and Tablesorter is a little tricky due to the fact that | |
// knockout tends to have a slight delay in load (if you are making an ajax call) | |
// and that table sorter likes to cache its value. To make them work together, | |
// on need to pay attention to execution order... | |
// | |
// Credit: Steve Sanderson http://bit.ly/H1B2Jm | |
// When binding your table, be sure to use the postAction event on the data-bind | |
// attribute to call the tablesorter() update method on your view: | |
// |
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
# Sorts an array based on a property of each object within the array | |
# | |
# Examples: | |
# | |
# [Em.Object.create(a: 1), Em.Object.create(a: 5), Em.Object.create(a: 3)].sortProperty('a') | |
# > [{a: 1}, {a: 3}, {a: 5}] | |
# | |
# As a computed property: | |
# | |
# AC = Em.ArrayController.extend |
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
bcrypt = require 'bcrypt' | |
class password | |
text = null | |
salt = null | |
hash = null | |
@saltAndHash = (text, done) -> | |
bcrypt.genSalt (err, salt) -> |
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
(use '[datomic.api :only (q db) :as d]) | |
(def initial-data | |
[{:sku "1" :price 0.95M :qty 1} | |
{:sku "2" :price 1.99M :qty 0} | |
{:sku "3" :price 1.99M :qty 0} | |
{:sku "4" :price 5.99M :qty 3} | |
{:sku "5" :price 9.99M :qty 2} | |
{:sku "6" :price 2.99M :qty 3} | |
{:sku "7" :price 2.99M :qty 2}]) |
OlderNewer