Skip to content

Instantly share code, notes, and snippets.

$ brew install selenium-server-standalone chromedriver
$ git clone [email protected]:theintern/intern.git
$ cd intern
$ npm install --production
$ ln -s .. node_modules/intern
$ curl https://gist.github.com/neonstalwart/6630466/raw/f0e4e4efbefa40c746f7c68e2bb4fa0dd5215047/selftest.local.intern.js > tests/selftest.local.intern.js
$ java -jar /usr/local/opt/selenium-server-standalone/selenium-server-standalone-2.35.0.jar -p 4444 &
$ node node_modules/intern/runner.js config=tests/selftest.local.intern

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"

npm adduser

@jtbonhomme
jtbonhomme / getRoutes.sh
Last active August 29, 2015 14:07
List all REST API routes
rm routes.txt
for i in *.py; do cat $i | grep "@.*('\/.*')" >> routes.txt; done
#!/bin/bash
#
# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04)
# Add Google Chrome's repo to sources.list
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source: http://www.google.com/linuxrepositories/)
@jtbonhomme
jtbonhomme / introrx.md
Last active August 29, 2015 14:09 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@jtbonhomme
jtbonhomme / nc.md
Last active May 10, 2025 13:16
Using Netcat for File Transfers

Netcat is like a swiss army knife for geeks. It can be used for just about anything involving TCP or UDP. One of its most practical uses is to transfer files. Non *nix people usually don't have SSH setup, and it is much faster to transfer stuff with netcat then setup SSH. netcat is just a single executable, and works across all platforms (Windows,Mac OS X, Linux).

Destination

On the receiving (destination) terminal, run:

nc -l -p 1234 > out.file 
@jtbonhomme
jtbonhomme / CrazyradioMacOsX.md
Last active August 29, 2015 14:12
Crazyradio install on Mac Os X (Snow Leopard, then Lion)

This article sum up my installation of crazyradio client on Os X. I started on Snow Leopard, but I had to move to Lion.

Install dependencies

Choose the one for your OS (I took the Snowleopard version 2.3.3-10.6)

"""
Script to import multiple directories with textile files into Confluence Wikis. Can be used with OnDemand instances.
To use as redmine migration tool, you need to export wiki pages in textile format. One way is described in: http://stbuehler.de/blog/article/2011/06/04/exporting_redmine_wiki_pages.html
~/redmine $ RAILS_ENV=production ./script/console -s
def export_text(p)
c = p.content_for_version(nil)
@jtbonhomme
jtbonhomme / proxy.md
Last active August 29, 2015 14:20
Set chrome proxy

OS X > Settings > Network > Advanced > Proxy

PAC script: file://localhost/Users/jtbonhomme/Desktop/proxy.pac

function FindProxyForURL(url, host)
{
	return "PROXY 127.0.0.1:3000";
}
@jtbonhomme
jtbonhomme / Mactip.md
Created June 19, 2015 04:54
[mac] Change Screenshot File Type

Change Screenshot File Type

If you don't like that screenshots are saved as PNG files on your Mac, you can switch it to either BMP, GIF, JPG, PDF, or TIFF instead. Just be sure to change the "png" portion of the below command to your desired file extension.

defaults write com.apple.screencapture type -string “png”