To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> High Sierra
| # coding=UTF-8 | |
| import nltk | |
| from nltk.corpus import brown | |
| # This is a fast and simple noun phrase extractor (based on NLTK) | |
| # Feel free to use it, just keep a link back to this post | |
| # http://thetokenizer.com/2013/05/09/efficient-way-to-extract-the-main-topics-of-a-sentence/ | |
| # Create by Shlomi Babluki | |
| # May, 2013 |
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
| # Changing iTerm2 color in MacOSX when SSHing (so you know at a glance that you're no longer in Kansas) | |
| # Adapted from https://gist.github.com/porras/5856906 | |
| # 1. Create a theme in your terminal setting with the name "SSH" and the desired colors, background, etc. | |
| # 2. Add this to your .bash_profile (or .bashrc, I always forget the difference ;)) | |
| # 3. Optional but useful: in the terminal, go to Settings > Startup and set "New tabs open with" to | |
| # "default settings" (otherwise, if you open a new tab from the changed one, you get a local tab with | |
| # the SSH colors) | |
| function tabc() { | |
| NAME=$1; if [ -z "$NAME" ]; then NAME="Default"; fi # if you have trouble with this, change |
| var util = require('util') | |
| , Transform = require('stream').Transform | |
| , StreamCombiner = require('./streamcombiner'); | |
| var chunks1 = []; | |
| var stream1 = new Transform(); | |
| var soFar = ''; | |
| stream1._transform = function(chunk, encoding, done) { | |
| chunks1.push(chunk.toString()); | |
| var pieces = (soFar + chunk).split('\n'); |
| // A streaming byte oriented JSON parser. Feed it a single byte at a time and | |
| // it will emit complete objects as it comes across them. Whitespace within and | |
| // between objects is ignored. This means it can parse newline delimited JSON. | |
| function jsonMachine(emit, next) { | |
| next = next || $value; | |
| return $value; | |
| function $value(byte) { | |
| if (!byte) return; | |
| if (byte === 0x09 || byte === 0x0a || byte === 0x0d || byte === 0x20) { |
| ///////////////// | |
| // Semantic.gs // for Stylus: http://learnboost.github.com/stylus/ | |
| ///////////////// | |
| // Defaults which you can freely override | |
| column-width = 60px | |
| gutter-width = 20px | |
| columns = 12 | |
| // Utility function |
| $ cat /media/state/units/docker-local.service | |
| [Service] | |
| Type=simple | |
| ExecStartPre=/bin/systemctl kill docker.service | |
| ExecStartPre=/bin/mount --make-rprivate / | |
| # Enable forwarding to allow NAT to work | |
| # TODO: Move this to sysctl.conf | |
| ExecStartPre=/sbin/sysctl -w net.ipv4.ip_forward=1 | |
| # Try to use this alternate way of starting docker if docker crashes for you: |
Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
| ;; http://www.learndatalogtoday.org/ | |
| ;; Find movie titles made in 1985 | |
| [:find ?title | |
| :where | |
| [?m :movie/year 1985] | |
| [?m :movie/title ?title]] | |
| ;; What year was "Alien" released? | |
| [:find ?year |
| // data comes from here http://stat-computing.org/dataexpo/2009/the-data.html | |
| // download 1994.csv.bz2 and unpack by running: cat 1994.csv.bz2 | bzip2 -d > 1994.csv | |
| // 1994.csv should be ~5.2 million lines and 500MB | |
| // importing all rows into leveldb took ~50 seconds on my machine | |
| // there are two main techniques at work here: | |
| // 1: never create JS objects, leave the data as binary the entire time (binary-split does this) | |
| // 2: group lines into 16 MB batches, to take advantage of leveldbs batch API (byte-stream does this) | |
| var level = require('level') |