Skip to content

Instantly share code, notes, and snippets.

View sjl's full-sized avatar

Steve Losh sjl

View GitHub Profile
(require '[lanterna.screen :as s])
(def scr (s/get-screen))
(s/start scr)
(s/put-string scr 10 10 "Hello, world!")
(s/put-string scr 10 11 "Press any key to exit!")
(s/redraw scr)
(s/get-key-blocking scr)
sjl at grendel in ~/Library/Application Support/Adobe/Lightroom/Develop Presets/VSCO Film 06 Push & Pull - Standard
><((°> ag 'Sharpness = 0' | grep lrtemplate
400H+1 +++.lrtemplate:66: Sharpness = 0,
400H+1 ++.lrtemplate:66: Sharpness = 0,
400H+1 -.lrtemplate:66: Sharpness = 0,
400H+1 +.lrtemplate:66: Sharpness = 0,
400H+1 Over +.lrtemplate:66: Sharpness = 0,
400H+1 Night.lrtemplate:66: Sharpness = 0,
400H+1 Over.lrtemplate:66: Sharpness = 0,
400H+1 Vibrant.lrtemplate:66: Sharpness = 0,
//////////////////////////// Auto-observe stars
// Start
starClick = setInterval(function() { $("#gameLog").find("input").click(); }, 2 * 1000);
// Stop
clearInterval(starClick);
////////////////////////// Autoconvert 'nip

How to become a decent photographer in five years

You're not gonna become a master in your spare time, but you can get decently good at photography in five years of dedicated but non-full-time practice. It's taken me about twice that to get decent, but I fucked around a lot along the way.

You don't need a ton of fancy equipment, but photography does require some gear. I'll limit the gear-buying here to once a year (not counting books).

@sjl
sjl / which is best? .py
Created November 16, 2009 20:16 — forked from inky/which is best? .py
They're completely different.
>>> x = '0123456789'
>>> a, b = [{} for _ in x], [{}] * len(x)
>>> a[0]['test'], b[0]['test'] = 1, 1
>>> p(a)
[{'test': 1}, {}, {}, {}, {}, {}, {}, {}, {}, {}]
>>> p(b)
# Discard local changes
git checkout -f (git co -f)
# This will change the current parent revision if you're not at a branch tip.
# The fact that it discards local changes is just a side effect.
hg update --clean (hg co -C)
# What you really want is the command *designed* to throw away changes: revert.
hg revert --all [--no-backup] (hg rev -a)
@sjl
sjl / .cdg.sh
Created April 29, 2010 16:57 — forked from bobthecow/cdg.bash
A function to cd to the root of the current Mercurial repository.
#!/usr/bin/env bash
# cd to the root of the current Mercurial repo
#
# usage:
# Add the following function to your `.bashrc` or `.bash_profile` file,
# or save it somewhere (i.e. `~/.cdg.sh`) and source it in `.bashrc`
cdh () {
hg root >/dev/null && cd "`hg root`"
#!/bin/bash
# Plant rope vim's plugin
# This is a script to install or update 'ropevim'
# Copyright Alexander Artemenko, 2008
# Contact me at svetlyak.40wt at gmail com
function create_dirs
{
mkdir -p src
@sjl
sjl / afacli.py
Created November 1, 2010 19:05
A command-line client for A Feed Apart
import json, time, urllib
n = 0
while 1:
try:
resp = json.load(urllib.urlopen('http://afeedapart.com/u/%s' % n))
except ValueError:
time.sleep(1)
continue
(defn usable-personalities
[personalities]
(filter #(> (:total %) 5) personalities))
(defn render-personality
[personality]
(str (:stddev personality)
","
(:score personality)
","