Skip to content

Instantly share code, notes, and snippets.

@tallus
tallus / jsquickstart.md
Last active Jan 22, 2020
Node JS Quck start cheat sheet
View jsquickstart.md

Node/JS Quick start

This should get you to the point of writing a first test. It assumes OS X with homebrew installed. (see https://brew.sh/)

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

@tallus
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
tallus / python-slack-bot.txt
Last active Feb 19, 2016
Python/Slack bot Links
View python-slack-bot.txt
https://medium.com/@julianmartinez/how-to-write-a-slack-bot-with-python-code-examples-4ed354407b98
https://medium.com/@julianmartinez/how-to-write-a-slack-bot-end-to-end-d6a8542c854b
https://api.slack.com/
https://api.slack.com/bot-users
https://github.com/slackhq/python-slackclient
https://github.com/slackhq/python-rtmbot
https://github.com/llimllib/limbo
https://github.com/loisaidasam/pyslack
@tallus
tallus / things_that_might_be_useful.md
Last active Aug 19, 2016
Things that might be useful...
View things_that_might_be_useful.md

...if only I could remember them.

Tools, modules etc. See also: tip sheet.

Python

@tallus
tallus / sh_resources.md
Last active Aug 19, 2016
Things to make the shell more awesome (maybe)
View gist:9e8f20200f4647d60fe5
https://medium.com/@julianmartinez/how-to-write-a-slack-bot-with-python-code-examples-4ed354407b98
https://medium.com/@julianmartinez/how-to-write-a-slack-bot-end-to-end-d6a8542c854b
https://api.slack.com/
https://api.slack.com/bot-users
https://github.com/slackhq/python-slackclient
https://github.com/slackhq/python-rtmbot
https://github.com/llimllib/limbo
https://github.com/loisaidasam/pyslack
View tip_sheet.md

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
@tallus
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]-->
<head>
<!-- Meta tags -->
@tallus
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
You can’t perform that action at this time.