Skip to content

Instantly share code, notes, and snippets.

@poetix
poetix / iterators.js
Created December 27, 2011 22:28
Lazy map, filter and reduce in Javascript
Iterators = (function() {
var each, map, filter, reduce, toArray, toObject;
function _map(iter, f) {
return {
hasNext: iter.hasNext,
next: function() { return f(iter.next()); }
};
}
@harthur
harthur / snippet.md
Created June 18, 2012 22:12
console.log() key binding for Sublime Text

Go to Sublime Text 2 > Preferences > Key Bindings - User and add this JSON to the file:

[
    { "keys": ["super+shift+l"],
      "command": "insert_snippet",
      "args": {
        "contents": "console.log(${1:}$SELECTION);${0}"
      }
 }
@willurd
willurd / web-servers.md
Last active July 3, 2024 13:20
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@simonewebdesign
simonewebdesign / install_sublime_text.sh
Last active March 11, 2024 12:23
Install Sublime Text 3 on Linux via POSIX shell script - http://simonewebdesign.it/install-sublime-text-3-on-linux/
#!/bin/sh
# Sublime Text 3 Install (last update: Monday 13 March 2017)
#
# No need to download this script, just run it on your terminal:
#
# curl -L git.io/sublimetext | sh
# Detect the architecture
@kstefanini
kstefanini / non-free.sh
Created September 24, 2014 10:02
Debian non-free script - Writes sources.list in order to add non-free repository
#!/bin/bash
#
# Writes sources.list in order to add non-free repository
#
DEBIAN_RELEASE=`cat /etc/*-release 2> /dev/null | grep PRETTY_NAME | awk -F "=" {'print $2'} | awk -F "(" {'print $2'} | awk -F ")" {'print $1'}`
echo "Writes /etc/apt/sources.list in order to add $DEBIAN_RELEASE non-free repository"

Git Cheat Sheet

Commands

Getting Started

git init

or

@594727294
594727294 / gist:2f218571089768870974
Last active July 15, 2020 20:08
~/.config/dunst/dunstrc
[global]
font = Helvetica 8
# allow a small subset of html markup:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough<s/>
# <u>underline</u>
#
# for a complete reference see http://developer.gnome.org/pango/stable/PangoMarkupFormat.html
/*
The MIT License (MIT)
Copyright (c) 2014
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@raine
raine / _post.md
Last active July 18, 2022 13:44
Parsing and rendering tori.fi categories with Acorn, archy and Ramda

Parsing and rendering tori.fi categories with Acorn, archy and Ramda

by @rane

Tori.fi, a Finnish online marketplace based on blocket.se, has a category selection input that dynamically reveals sub-categories as user selects them.

It works like this: