Skip to content

Instantly share code, notes, and snippets.

View brabadu's full-sized avatar

Boryslav Larin brabadu

View GitHub Profile
@brabadu
brabadu / gist:1259801
Created October 3, 2011 18:09
My ST2 config
{
"draw_white_space": "all",
"font": "monospace",
"font_size": 11,
"translate_tabs_to_spaces": true,
"vintage_start_in_command_mode": true,
"vintage_ctrl_keys": true,
"color_scheme": "Packages/Color Scheme - Default/Pastels on Dark.tmTheme"
}
@brabadu
brabadu / pykwargs.py
Created December 25, 2012 12:55
kwargs-based templating
def third(third_css, n):
print third_css, n
def second(q, third_p, third_css=''):
print q
third(third_css, **third_p)
return q
def first(a, b, second_p, d):
@brabadu
brabadu / companies.txt
Created January 28, 2013 22:36
Trying clojure for doing small things. Generate CSV-file from bunch of lines.
Company 123
Sales One
Account Two
-------
Company 456
Sales Er
Account zxcv
-------
Company 33
Sales CVC
@brabadu
brabadu / zippers.clj
Last active December 12, 2015 04:58
handmade zippers
(def seq-zip
(fn [tree]
{:here tree
:parents '()
:lefts '()
:rights '()}))
(def zdown
(fn [zipper] (if (empty? (:here zipper))
nil
@brabadu
brabadu / flickr-search.html
Last active January 31, 2018 06:09
flickr search example
<html>
<head>
<title>Flickr search demo</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style>
.gallery__item {
float: left;
height: 100;
list-style: none;
};
@brabadu
brabadu / chart.html
Created October 14, 2013 04:45
FB React Charts
<html>
<head>
<script type='text/javascript' id='lt_ws' src='http://localhost:51068/socket.io/lighttable/ws.js'></script>
<script src='build/JSXTransformer.js'></script>
<script src='build/react.js'></script>
<style>
.bars {
width: 400px;
height: 200px;
@brabadu
brabadu / gist:2a9f77f85cc3ab2a9f84
Last active August 29, 2015 14:09
react in lighttable
(ns lt.plugins.user
(:require [clojure.string :as string]
[lt.object :as object]
[lt.objs.tabs :as tabs]
[lt.objs.command :as cmd])
(:require-macros [lt.macros :refer [defui behavior]]))
(defui react-panel [this]
[:h1 {:id "app-root"} "React + LightTable!"])
@brabadu
brabadu / descriptions.clj
Last active August 29, 2015 14:13
Generate a oneline descriptions for github repo with API
(ns example
(:require [clojure.data.json :as json]
[clojure.string :as string]))
(defn descriptions [repos]
(map (fn [html-repo] (let [
api-repo (string/replace html-repo #"github.com" "api.github.com/repos")
json-resp (json/read-str (slurp api-repo)
:key-fn keyword)
name (:name json-resp)
@brabadu
brabadu / gist:8b3596559099d4cb5d101d1ecdcc4f02
Last active June 8, 2017 21:41
Experiments with effect cancelation in tanok
import Rx from 'rx';
Rx.config.longStackSupport = true;
function firstFx(n){
const a = function (stream, bus) {
return Rx.Observable
.fromPromise(
new Promise((resolve) => setTimeout(() => resolve(n + a.label), 1000))
)