This file contains hidden or 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
defmacro def_identity_matcher(name, map) do | |
quote do | |
def unquote(name)(unquote(map)), do: unquote(map) | |
end | |
end |
This file contains hidden or 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 fs = require('fs'); | |
function readFiles(dirname, onFileContent, onError) { | |
fs.readdir(dirname, function(err, filenames) { | |
if (err) { | |
onError(err); | |
return; | |
} | |
filenames.forEach(function(filename) { | |
fs.readFile(dirname + filename, 'utf-8', function(err, content) { |
This file contains hidden or 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
import Html exposing (..) | |
import Html.Attributes exposing (..) | |
import Html.App as Html | |
import Html.Events exposing (onInput, onClick) | |
import String exposing (..) | |
import Random exposing (..) | |
main = | |
Html.program | |
{ |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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) { |