Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| #!/usr/bin/env node | |
| var argv = require('optimist') | |
| .usage('Usage: --key=[consumer key] -secret=[consumer secret]') | |
| .demand(['key', 'secret']) | |
| .argv | |
| ; | |
| var OAuth = require('oauth').OAuth; | |
| var Step = require('step'); |
| var Parser = require('./jsonparse'); | |
| var Http = require('http'); | |
| var p = new Parser(); | |
| // IMPORTANT, put your username and password in here | |
| var username = "yourTwitterUsername", password = "yourPassword"; | |
| var client = Http.createClient(80, "stream.twitter.com"); | |
| var request = client.request("GET", "/1/statuses/sample.json", { | |
| "Host": "stream.twitter.com", | |
| "Authorization": (new Buffer(username + ":" + password)).toString("base64") | |
| }); |
| #!/bin/bash | |
| SESSION=main | |
| tmux="tmux -2" | |
| # if the session is already running, just attach to it. | |
| $tmux has-session -t $SESSION | |
| if [ $? -eq 0 ]; then | |
| echo "Session $SESSION already exists. Attaching." | |
| sleep 1 |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| <?php | |
| /* | |
| Plugin Name: Rich Text editors for Gravity Forms | |
| Description: Converts the textarea fields in Gravity Forms to WordPress rich text editors | |
| Author: Nathaniel Taintor | |
| Author URI: http://goldenapplesdesign.com | |
| Version: 1.0 | |
| License: GPLv2 | |
| */ |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteCond %{DOCUMENT_ROOT}/static/%{REQUEST_URI} -f | |
| RewriteRule ^(.*)$ /static/$1 [L,QSA] | |
| RewriteCond %{DOCUMENT_ROOT}/static/%{REQUEST_URI}/index.html -f | |
| RewriteRule ^(.*)$ /static/$1/index.html [L,QSA] | |
| RewriteRule ^index\.php$ - [L] |
I recently had the following problem:
We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like
ssh -L 3306:localhost:3306 remotehost