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
.directive('inputImage', function() { | |
'use strict' | |
return { | |
template: "<input type='file' accept='image/*'>", | |
restrict: 'E', | |
require: "ngModel", | |
link: function (scope, element, attrs, ngModel) { | |
element.bind('change', function (evt) { |
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
.directive("autoUpdate", function(debounce_timeout){ | |
return { | |
require: "ngModel", | |
link: function(scope, element, attrs, ngModel){ | |
var model_path_array = attrs.ngModel.split("."); | |
var field_name = _.last(model_path_array); | |
var model_name = _.chain(model_path_array).last(2).first().value(); | |
function save_model_to_backend(){ |
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
;; User keymap | |
;; ----------------------------- | |
;; Keymaps are stored as a set of diffs that are merged together to create | |
;; the final set of keys. You can modify these diffs to either add or | |
;; subtract bindings. | |
;; | |
;; Like behaviors, keys are bound by tag. When objects with those tags are active | |
;; the key bindings are live. Keys can be bound to any number of Light Table commands, | |
;; allowing you the flexibility to execute multiple operations together. To see a list | |
;; of all the commands you can execute, start typing a word related to the thing you |
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
(ns chestnut-test2.core | |
(:require | |
[cljs.core.async :as async :refer [chan close! <! >! put! timeout alts! to-chan]]) | |
(:require-macros | |
[cljs.core.async.macros :refer [go go-loop]])) | |
(def c (to-chan [1 2 3 4])) ;;works | |
(go (print (<! c))) ;;works |
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
(defn versions-to-fetch [local remote] | |
(let [versions-missing (second (diff local remote))] | |
(->> versions-missing | |
(map #(with-meta (select-keys % [:sha]) %)) | |
set | |
(map meta) | |
set))) | |
(def data | |
#{{:date "2014-12-08T18:44:53.846-00:00", :id 1, :location "apps/version1.js", |
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
(def file-locations-from-shas | |
'[ :find ?location | |
:in $ [[?sha]] | |
:where | |
[?e :file/sha ?sha] | |
[?e :file/location ?location]]) |
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
#!/bin/bash | |
echo running pre-push hook for jshint | |
# Make a temp directory for writing the .jshintrc file | |
TMP_DIR=`mktemp -d` | |
EXIT_CODE=0 | |
# Run JSHint on the file and redirect the output back to Git | |
jshint `git root` >&2 |
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
(helper-macro menubuttons :Field :Type :Collation :Attributes :Null :Default :Extra :Action) | |
;produces | |
(defstruct menubuttons-fields :Field :Type :Collation :Attributes :Null :Default :Extra :Action ) | |
(def *menubuttons-csv-file* "data/menubuttons.csv") | |
(defn fetch-menubuttons-data [] (load-data-from-csv *menubuttons-csv-file* inventory-fields)) |
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
(defn contains-transaction? [transactions transaction] (contains? transactions (:TransactionID transaction))) | |
(defmulti conj-transaction contains-transaction?) | |
(defmethod conj-transaction true [transactions transaction] | |
(let[id (:TransactionID transaction) | |
transaction-list (get transactions id)] | |
(assoc transactions id (conj transaction-list transaction)))) | |
(defmethod conj-transaction false [transactions transaction] | |
(let [id (:TransactionID transaction)] |
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
(defn contains-transaction? [transactions transaction] (contains? transactions (:TransactionID transaction))) | |
(defmulti conj-transaction contains-transaction?) | |
(defmethod conj-transaction true [transactions transaction] | |
(let[id (:TransactionID transaction) | |
transaction-list (get transactions id)] | |
(assoc transactions id (conj transaction-list transaction)))) | |
(defmethod conj-transaction false [transactions transaction] | |
(let [id (:TransactionID transaction)] |
OlderNewer