Skip to content

Instantly share code, notes, and snippets.

tallus / gist:6847975
Last active Dec 24, 2015
Python functions that returns a list of directories in a directory, with fully qualified paths, using ridiculous list constructor that I'm quite proud of
View gist:6847975
def get_directory_list(dpath):
'''returns a list of directories in a directory,
with fully qualified paths'''
if not os.path.isdir(dpath):
raise MyError('oops %s is not a directory'% dpath)
dirs = [os.path.join(dpath, filename) for filename in os.listdir(dpath) if (os.path.isdir(os.path.join(dpath, filename)))]
return dirs
tallus / IndieTumblrTheme
Last active Aug 29, 2015
An IndieWebify-ied Tumblr Theme
View IndieTumblrTheme
<!doctype html>
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html lang="en" class="no-js"> <!--<![endif]-->
<!-- Meta tags -->

Vim Tips

  • gv redo visual selection
  • :%s/\s\+$// Delete unwanted white space
  • :%s/,([^ ])/, \1/g Add spaces after commas
  • :s/MATCH/&ADD apend ADD after MATCH
  • %s/".{-}", //g .{-} non greedy match e.g. "foo", 1, "bar", 2 -> 1, 2
  • :[RANGE]g/MATCH COMMAND1 | COMMAND2... for lines matching MATCH (in RANGE) execute COMMAND1, COMMAND2 etc.
  • :g/MATCH/d Delete all lines containing MATCH (remove d to show lines)
  • :g/^\s*$/d Delete all blank lines
  • :g!/^\s*H/d Delete all lines that are not comments
View gist:9e8f20200f4647d60fe5
tallus /
Last active Aug 19, 2016
Things to make the shell more awesome (maybe)
tallus /
Last active Aug 19, 2016
Things that might be useful...

...if only I could remember them.

Tools, modules etc. See also: tip sheet.


tallus / python-slack-bot.txt
Last active Feb 19, 2016
Python/Slack bot Links
View python-slack-bot.txt
tallus / syntax.clj
Created Nov 24, 2017
Cloure Syntax Notes
View syntax.clj
;; this is a comment
;; Never use single quotes allways use double quotes
;; % is like an anonymous function argumenrt
;; assignment
;; globally scoped to name-space
(def foo 1)
(== foo 1) ;; true
tallus /
Last active Jan 22, 2020
Node JS Quck start cheat sheet

Node/JS Quick start

This should get you to the point of writing a first test. It assumes OS X with homebrew installed. (see

On Linux you should be able to substitute apt-get, yum etc when brew is mentioned. It might help to have node and npm already installed but we will be wrapping tooling around these.

This is geared towards Node but it should be the same for front-end code with test AFAIK (feel free to correct me).

Ive used

You can’t perform that action at this time.