Skip to content

Instantly share code, notes, and snippets.

@chbrown
chbrown / Instructions.md
Created June 25, 2015 02:46
Installing TypeScript-Sublime-Plugin at 0.1.4
  1. First, uninstall the PackageControl-installed version: Command+Shift+P -> Remove -> Typescript

  2. In your terminal: cd "$HOME/Library/Application Support/Sublime Text 3/Packages/"

  3. In that directory: git clone https://github.com/Microsoft/TypeScript-Sublime-Plugin.git TypeScript

    This is pretty much the source-install process from the plugin's readme, except without --depth 1, which pulls only the latest revision.

  4. Go into the repository: cd TypeScript

  5. And checkout the latest good version: git checkout 0.1.4

  6. Quit Sublime Text and restart

@chbrown
chbrown / the-dog-bit-a-girl.xml
Last active August 29, 2015 14:16
TreeForm output
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<sentence defaultfontsize="10" file="/Users/chbrown/github/tree-js/tmp/the-dog-bit-a-girl.xml" lefttranslate="20" linelength="10" mintextwidth="30" name="the-dog-bit-a-girl.xml" toptranslate="20" type="TreeForm">
<syntacticstructure lineblue="0" linegreen="0" linered="0" string="13165790" syntacticlevel="HEAD">
<text text="S ">
<N0 backgroundblue="255" backgroundgreen="255" backgroundred="255" font="Dialog" foregroundblue="0" foregroundgreen="0" foregroundred="0" size="10" strikethrough="false" style="0" subscript="normal" underline="false"/>
<N1 font="Dialog" size="10" style="0" subscript="normal"/>
</text>
<syntacticfeaturesets/>
<syntacticassociations/>
<starttraces/>

First traceroute runs

root@(none):~# traceroute index.docker.io

traceroute to index.docker.io (162.242.195.84), 30 hops max, 60 byte packets
 1  178.62.0.253 (178.62.0.253)  6.960 ms  6.943 ms  6.914 ms
 2  5.101.111.229 (5.101.111.229)  0.323 ms 5.101.111.237 (5.101.111.237)  0.307 ms  0.293 ms
 3  212.119.29.53 (212.119.29.53)  0.707 ms  0.706 ms  0.728 ms
 4  ae-6.r02.londen03.uk.bb.gin.ntt.net (129.250.3.2)  1.777 ms ae-1.r02.londen01.uk.bb.gin.ntt.net (129.250.3.36)  1.906 ms  1.753 ms

5 ae-6.r02.londen03.uk.bb.gin.ntt.net (129.250.3.2) 1.974 ms 1.912 ms 2.048 ms

@chbrown
chbrown / bit.ly.webloc
Created August 21, 2014 16:49
URL shortener in one line of URLs
http://bit.ly/
@chbrown
chbrown / GrasswireUrlShortener.errors
Created August 21, 2014 16:43
`scala GrasswireUrlShortener.scala` result
/Users/chbrown/Desktop/GrasswireUrlShortener.scala:3: error: object apache is not a member of package org
import org.apache.commons.validator.routines.UrlValidator
^
/Users/chbrown/Desktop/GrasswireUrlShortener.scala:4: error: not found: value spray
import spray.http.StatusCodes
^
/Users/chbrown/Desktop/GrasswireUrlShortener.scala:5: error: not found: value spray
import spray.routing._
^
/Users/chbrown/Desktop/GrasswireUrlShortener.scala:7: error: not found: value scalaz
@chbrown
chbrown / terminal_hist.py
Created October 27, 2013 04:15
Numpy-powered CLI histogram
import os
import numpy as np
term_rows, term_columns = map(int, os.popen('stty size', 'r').read().split())
def hist(xs, margin=10, width=term_columns):
# I'm not sure why my font in iterm doesn't like \u2588, but it looks weird.
# It's too short and not the right width.
chars = u' \u2581\u2582\u2583\u2584\u2585\u2586\u2587\u2589'
@chbrown
chbrown / gist:6632529
Created September 20, 2013 02:15
Brown clefts, maybe perl -ne "/it was .+ (who|that)/i && print $1"
Several signers affixed their names, it was learned, after being told that no tax increase would be possible without consent of the General Assembly and that a provision could be included in the charter to have the town take over the Johnston Sanitary District sewer system.
It was generally agreed that the subject was important and the board should be informed on what was done, is going to be done and what it thought should be done.
It was the first of two doubles by Robinson, who was in a mood to celebrate.
It was a real stimulant to a lot of guys I know who have moved past the 2-score-year milestone.
It was neither a spirit of self-sacrifice nor a yen to encourage the downtrodden that motivated Arnold.
It was a nice round figure, that 12, he said as he headed for the clubhouse, not too much perturbed.
It was about that time, a board member said later, that Dr. Thomas G. Pullen, Jr., State superintendent of schools, told Dr. Jenkins and a number of other education officials that he would not talk to them wit
@chbrown
chbrown / gist:6272118
Created August 19, 2013 17:59
tweedr install error
[chbrown@air ~/github/tweedr]$ python setup.py develop
running develop
Checking .pth file support in /Library/Python/2.7/site-packages/
/usr/bin/python -E -c pass
TEST PASSED: /Library/Python/2.7/site-packages/ appears to support .pth files
running egg_info
writing requirements to tweedr.egg-info/requires.txt
writing tweedr.egg-info/PKG-INFO
writing top-level names to tweedr.egg-info/top_level.txt
writing dependency_links to tweedr.egg-info/dependency_links.txt
@chbrown
chbrown / gist:5854153
Created June 24, 2013 22:13
nodegit woes
$ gdb --args node --noopt --nocache_optimized_code --nooptimize_closures cli.js gitlist ~/src/akka
GNU gdb 6.3.50-20050815 (Apple version gdb-1824) (Wed Feb 6 22:51:23 UTC 2013)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ........ done