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
aaron@aaron-laptop:~$ mkdir newsite | |
aaron@aaron-laptop:~$ cd newsite | |
aaron@aaron-laptop:~/newsite$ git init | |
Initialized empty Git repository in /home/aaron/newsite/.git/ | |
aaron@aaron-laptop:~/newsite$ cat > newsite.py | |
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def hello_world(): |
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
module.exports = (robot) -> | |
robot.router.post "/hubot/say", (req, res) -> | |
room = req.body.room | |
message = req.body.message | |
robot.logger.info "Message '#{message}' received for room #{room}" | |
user = robot.userForId 'broadcast' | |
user.room = room | |
user.type = 'groupchat' | |
robot.send user, "#{message}" | |
res.writeHead 200, {'Content-Type': 'text/plain'} |
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
/* ==================================================================== | |
* Copyright (c) 2012 The Apache Group. All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* | |
* 1. Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. |
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
U = require 'underscore' | |
H = require 'scoped-http-client' | |
T = require 'util' | |
H.create('https://api.github.com/') | |
.header('accept', 'application/json') | |
.path('repos/insom/pymogile/commits') | |
.get() (e, r, b) -> | |
v = U.map JSON.parse(b).filter((item) -> item['committer']), | |
(item) -> [item['url'], item['commit']['committer']['name'], | |
item['commit']['committer']['date'].substring(0,10)] |
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/env ruby | |
require 'net/http' | |
require 'JSON' | |
require 'YAML' | |
url = "http://localhost:8000/hosting/json/#{ARGV[0]}/" | |
r = Net::HTTP.get_response(URI.parse(url)) | |
o = JSON.parse(r.body) | |
puts o.to_yaml |
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
alias ss="ssh $1.manc.iws-hosting.co.uk" | |
# Color codes | |
RED='\[\033[01;31m\]' | |
GREEN='\[\033[01;32m\]' | |
YELLOW='\[\033[01;33m\]' | |
BLUE='\[\033[01;34m\]' | |
PURPLE='\[\033[01;35m\]' | |
CYAN='\[\033[01;36m\]' | |
WHITE='\[\033[01;37m\]' | |
NIL='\[\033[00m\]' |
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
# Thomas Parslow http://almostobsolete.net | |
# Just a work in progress and adapted to what I need right now. | |
# It does uploads (via a file-like object that you write to) and | |
# I've started on downloads. Needs the development version of Boto from Github. | |
# | |
# Example: | |
# | |
# glacierconn = GlacierConnection(AWS_ACCESS_KEY, AWS_SECRET_ACCESS_KEY) | |
# writer = GlacierWriter(glacierconn, GLACIER_VAULT) | |
# writer.write(somedata) |
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 | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4 | |
# Based on work Copyright (c) 2012 Openstack, LLC. | |
import Cookie | |
import os | |
import socket | |
import sys | |
import websockify |
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
""""Create "The Matrix" of binary numbers scrolling vertically in your terminal. | |
original code adapted from juancarlospaco: | |
- http://ubuntuforums.org/showpost.php?p=10306676 | |
Inspired by the movie: The Matrix | |
- Corey Goldberg (2013) | |
Requires: |
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
import sys, time | |
while True: | |
for i in range(311, 319): | |
print "\r", eval("u'\U0001f%d'" % i), "", | |
sys.stdout.flush() | |
time.sleep(0.1) |