I 'm fleshing out some of these ideas here: https://github.com/lynaghk/todoFRP/tree/master/todo/angular-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
#! /usr/bin/env python | |
""" Convert values between RGB hex codes and xterm-256 color codes. | |
Nice long listing of all 256 colors and their codes. Useful for | |
developing console color themes, or even script output schemes. | |
Resources: | |
* http://en.wikipedia.org/wiki/8-bit_color | |
* http://en.wikipedia.org/wiki/ANSI_escape_code |
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
// LZW-compress a string | |
function lzw_encode(s) { | |
var dict = {}; | |
var data = (s + "").split(""); | |
var out = []; | |
var currChar; | |
var phrase = data[0]; | |
var code = 256; | |
for (var i=1; i<data.length; i++) { | |
currChar=data[i]; |
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
DOC_PATH = "./Closure.docset/Contents/Resources/Documents" | |
DB_PATH = "./Closure.docset/Contents/Resources/docSet.dsidx" | |
CLOSURE_GIT_URL = "https://code.google.com/p/closure-library.docs/" | |
ICON_URL = "http://docs.closure-library.googlecode.com/git/static/images/16px.png" | |
# Setup | |
puts "Setting up..." | |
system("mkdir -p #{DOC_PATH}") | |
puts "Downloading documentation..." |
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 react-cljs.core | |
(:require React)) | |
(declare render) | |
(defn handle-change [e] | |
(render {:text (.. e -target -value)})) | |
(defn render [{:keys [text]}] | |
(React/renderComponent |
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 get_request(): | |
""" | |
blindly walks up the stack looking for | |
request.user | |
""" | |
for i in itertools.count(): | |
try: | |
frame = sys._getframe(i) | |
except ValueError: | |
frame = None |
Find it here: https://github.com/bitemyapp/learnhaskell
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
(defun g-blame () | |
"Which commits last affected this line?" | |
(interactive) | |
(shell-command | |
(format "git show $(git blame '%s' -L %s,%s | awk '{print $1}')" | |
(buffer-file-name) | |
(line-number-at-pos) | |
(line-number-at-pos)))) | |
(defun g-churn () |
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
This is my short-ish tutorial on how to implement closures in | |
a simple functional language: Foo. | |
First, some boilerplate. | |
> {-# LANGUAGE DeriveFunctor, TypeFamilies #-} | |
> import Control.Applicative | |
> import Control.Monad.Gen | |
> import Control.Monad.Writer | |
> import Data.Functor.Foldable |
OlderNewer