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 middleware) | |
(def default-response | |
{:status :init | |
:done false | |
:value nil}) | |
(def default-request |
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/env python | |
# Requires: youtube_dl module | |
# Requires: ffmpeg | |
# Usage: | |
# | |
# python youtube2mp3.py <URL>, ... | |
# | |
# Example: | |
# | |
# python youtube2mp3.py https://www.youtube.com/watch?v=dQw4w9WgXcQ |
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
;; In response to blog post: | |
;; https://medium.com/@kasperpeulen/10-features-from-various-modern-languages-that-i-would-like-to-see-in-any-programming-language-f2a4a8ee6727 | |
;; Run with lumo | |
;; https://github.com/anmonteiro/lumo | |
;; | |
;; # npm install -g lumo-cljs | |
;; lumo clojurescript-feature-examples.cljs |
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
@import 'https://fonts.googleapis.com/css?family=Droid+Serif|Inconsolata'; | |
* { | |
font-family: 'Droid Serif', serif; | |
} | |
#content { | |
margin: 20px auto; | |
padding: 20px; | |
max-width: 800px; |
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
(if (not (window-system)) | |
(progn | |
(package-require 'color-theme) | |
(color-theme-initialize) | |
(color-theme-tty-dark)) | |
(progn | |
(package-require 'waher-theme) | |
(load-theme 'waher t t))) |
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 redditv.jsonp | |
(:require-macros [cljs.core.async.macros :refer [go]]) | |
(:require [cljs.core.async :refer [put! chan <! close!]]) | |
(:import [goog.net Jsonp] | |
[goog Uri])) | |
(defn send-jsonp [url] | |
(let [success-channel (chan) | |
error-channel (chan) | |
success-handler (fn [result] (if-not (nil? result) |
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
from types import ( | |
ListType, | |
TupleType, | |
FunctionType, | |
LambdaType | |
) | |
def thread_first(expr, *exprs): | |
for expression in exprs: | |
if type(expression) in [ListType, TupleType]: |
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 event | |
"Macros for event.cljs") | |
(defmacro on-keydown [key & body] | |
`(set-on-keydown ~key (fn [] ~@body))) | |
(defmacro on-keyup [key & body] | |
`(set-on-keyup ~key (fn [] ~@body))) |
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 array2 | |
"Simple and helpful functions for manipulating 2d arrays. This is a set | |
of functions for manipulating a mutable js/Array instance, and | |
treats it like a 2d array. This is useful for the domain of 2d games. | |
Examples: | |
(def array1 (aa 1 2)) | |
(def array2 (aa 3 4)) |
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 | |
#allows you to perform a rebase on your current branch with the master | |
#branch | |
#turn off the proxy | |
#. unsetproxy | |
CURRENT_BRANCH="`git rev-parse --abbrev-ref HEAD`" |