git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| # How to echobot with XMPP, BOSH, and Strophe | |
| 1. Setup ejabberd(http://www.ejabberd.im/) server and setup account [email protected] | |
| NOTE: localhost should be enough. If you setup something else, make sure you add it at /etc/hosts like this | |
| #/etc/hosts | |
| 127.0.0.1 localhost.local | |
| NOTE: Also download Psi(http://psi-im.org/), and make sure you can connect to your ejabberd server. | |
| 2. Download strophe(http://code.stanziq.com/strophe/) and place it (eg: /Users/makoto/work/sample/strophejs-1.0) |
| // g100pon #33 BBS | |
| // Usage: | |
| // groovy -l 8080 BBS.groovy | |
| // Open 'http://localhost:8080' | |
| @Grapes([@Grab('com.h2database:h2:1.2.144'), @GrabConfig(systemClassLoader=true)]) | |
| import groovy.xml.MarkupBuilder | |
| import groovy.sql.Sql | |
| sql = Sql.newInstance('jdbc:h2:.bbs/db', 'sa', '', 'org.h2.Driver') | |
| sql.execute('create table if not exists bbs (id INT AUTO_INCREMENT, text VARCHAR)') |
| # ~/.tmux.conf | |
| # | |
| # See the following files: | |
| # | |
| # /opt/local/share/doc/tmux/t-williams.conf | |
| # /opt/local/share/doc/tmux/screen-keys.conf | |
| # /opt/local/share/doc/tmux/vim-keys.conf | |
| # | |
| # URLs to read: | |
| # |
| """ | |
| (MIT License) | |
| Copyright (c) 2011 Jason Webb | |
| 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 furnished to do so, subject to the following conditions: | |
| The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWA |
| #!/bin/bash | |
| # A script that squashes your entire current branch down to a single commit, | |
| # if this repository has a single root commit. This will change the object | |
| # name of the root commit. This is for an answer to the Stack Overflow | |
| # question: http://stackoverflow.com/questions/5266340/ | |
| if [ -n "$(git status --porcelain)" ] | |
| then | |
| echo "git status wasn't clean - refusing to run..." |
| # | |
| # Wide-open CORS config for nginx | |
| # | |
| location / { | |
| if ($request_method = 'OPTIONS') { | |
| add_header 'Access-Control-Allow-Origin' '*'; | |
| # |
| #! /usr/bin/env python | |
| import redis | |
| import random | |
| import pylibmc | |
| import sys | |
| r = redis.Redis(host = 'localhost', port = 6389) | |
| mc = pylibmc.Client(['localhost:11222']) |
| /* Animate to natural width */ | |
| body { background: black; padding: 100px; margin: 0; } | |
| .progress-bar { | |
| border: 2px solid red; | |
| border-radius: 14px; | |
| } | |
| .progress-bar > div { |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!