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 schema-explain | |
"Provides a function to transform Prismatic's Schema | |
errors into a flat readable vector of `error keys`." | |
(:require [schema.core :as s] | |
[schema.utils :as u] | |
[clojure.string :as str]) | |
(:import [schema.utils ValidationError NamedError])) | |
(defn- flatten-tree | |
"Flattens a tree. |
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 util.db-mapper | |
(:require [clojure.java.jdbc :refer :all] | |
[clojure.string :as str]) | |
(:import [java.sql ResultSet] )) | |
(comment | |
"mapping should be something like this:" | |
{:rel [:oauth_access_tokens :users] | |
:fkey :user_id |
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
/** | |
A slight variant of http://rocketshake.tumblr.com/post/424849450/infinite-scroll | |
This file has been uploaded to http://static.tumblr.com/fpifyru/F4wm4bbxj/autopager.js | |
**/ | |
var tumblrAutoPager = { | |
url: "http://proto.jp/", | |
ver: "0.1.7", | |
rF: true, | |
gP: {}, |
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
machine git.heroku.com | |
login this_will_be_ignored_so_you_could_write_anything_here | |
password: heroku_api_key |
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 pixels.core | |
(:require [reagent.core :as reagent :refer [atom]])) | |
(def size 20) | |
(def point | |
;; Компонент для реагента. | |
[:div.pixel]) | |
(def white-point |
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
stop on (stopping puma-manager or runlevel [06]) | |
setuid dev | |
setgid dev | |
respawn | |
respawn limit 3 30 | |
normal exit 0 TERM | |
script |
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
(comment ; Fun with transducers, v2 | |
;; Still haven't found a brief + approachable overview of Clojure 1.7's new | |
;; transducers in the particular way I would have preferred myself - so here goes: | |
;;;; Definitions | |
;; Looking at the `reduce` docstring, we can define a 'reducing-fn' as: | |
(fn reducing-fn ([]) ([accumulation next-input])) -> new-accumulation | |
;; (The `[]` arity is actually optional; it's only used when calling | |
;; `reduce` w/o an init-accumulator). |
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
; ====== Core ====== | |
(ns learning.core | |
"Main class" | |
(:require [learning.listutils :as l] :verbose)) | |
(defn -main | |
"I don't do a whole lot ... yet." | |
[& args] | |
(time |
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 merge_sort_rec(_list): | |
def sort(_list): | |
if len(_list) == 0 or len(_list) == 1: | |
return _list | |
else: | |
(left, right) = split(_list) | |
return merge(sort(left), sort(right)) | |
def merge(left, right): | |
if len(left) == 0 or len(right) == 0: |
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
$ -> | |
if window.devicePixelRatio? and window.devicePixelRatio is 2 | |
$("img.retinaReady").each -> | |
$(@).attr('src', retinaUrl) if (retinaUrl = $(@).data 'retina_path')? |