This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// HipChat PHP library: https://github.com/hipchat/hipchat-php | |
include 'HipChat.php'; | |
$token = "<your token>"; | |
$room = "Development"; | |
$message = 'Some <b>html</b>, <entities>, and a <a href="https://www.hipchat.com">link</a>.<br />We can even use line breaks!'; | |
$hc = new HipChat($token); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Basic XMPP bot example for HipChat using node.js | |
// To use: | |
// 1. Set config variables | |
// 2. Run `node hipchat_bot.js` | |
// 3. Send a message like "!weather 94085" in the room with the bot | |
var request = require('request'); // github.com/mikeal/request | |
var sys = require('sys'); | |
var util = require('util'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# On Ubuntu 10.04.1 LTS this is added "libmozjs-dev" after upgrading form 0.9.8 to 0.9.12 | |
dev_pkgs << value_for_platform( | |
"debian" => { "default" => "libmozjs-dev" }, | |
"ubuntu" => { | |
"9.04" => "libmozjs-dev", | |
"9.10" => "libmozjs-dev", | |
"default" => "xulrunner-dev" | |
} | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os | |
def daemonize(): | |
# See http://www.faqs.org/faqs/unix-faq/programmer/faq/ - Section 1.7 | |
print('--- %s: daemonizing' % os.getpid()) | |
if os.fork(): # launch child and... | |
print('--- %s: kill parent 1' % os.getpid()) | |
os._exit(0) # kill off parent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GitHub tarball downloads contain a folder inside named: <user>-<project>-<hash> | |
$ tag='v1.3.12' | |
$ curl -sL http://github.com/antirez/redis/tarball/$tag -o redis-$tag.tar.gz | |
$ dir=$(tar zxvf redis-$tag.tar.gz | tail -1 | cut -d "/" -f1) | |
$ cd $dir | |
$ make | |
Is there a cleaner way to cd to the directory inside the tarball? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2010-09-03_14:34:24.70801 Merb root at: /usr/lib/ruby/gems/1.8/gems/chef-server-api-0.9.8 | |
2010-09-03_14:34:24.70808 ~ No Gemfile found! If you're generating new app with merb-gen this is fine, otherwise run: bundle init to create Gemfile | |
2010-09-03_14:34:24.70822 Loading init file from ./config/init.rb2010-09-03_14:34:25.06675 WARN: HTTP Request Returned 500 Internal Server Error: error | |
2010-09-03_14:34:25.06701 /usr/lib/ruby/1.8/net/http.rb:2097:in `error!': 500 "Internal Server Error" (Net::HTTPFatalError) | |
2010-09-03_14:34:25.06713 from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/lib/chef/rest.rb:229:in `api_request' | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deploy_branch "/tmp/txredis" do | |
repository "git://github.com/deldotdr/txRedis.git" | |
branch "master" | |
restart_command "python setup.py install" | |
purge_before_symlink Array.new | |
create_dirs_before_symlink Array.new | |
symlinks Hash.new | |
symlink_before_migrate Hash.new | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var task = require('./task'); | |
var t1 = new(task.Task)("Blah"); | |
var t2 = new(task.Task)("Foo"); | |
sys.puts(t1.getBody()); | |
sys.puts(t2.getBody()); | |
var tasks = task.getTasks(); | |
sys.puts(sys.inspect(tasks)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
squaw:/tmp curl http://npmjs.org/install.sh | sh | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
122 244 122 244 0 0 1088 0 --:--:-- --:--:-- --:--:-- 2904 | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 555k 100 555k 0 0 62125 0 0:00:09 0:00:09 --:--:-- 74607 | |
node cli.js cache clean | |
npm it worked if it ends with ok | |
npm cli [ 'cache', 'clean' ] |