Skip to content

Instantly share code, notes, and snippets.

@endolith
endolith / Has weird right-to-left characters.txt
Last active July 17, 2024 12:41
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@huyng
huyng / reflect.py
Created February 7, 2011 17:57
A simple echo server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
@fperez
fperez / lp2gh-issues.py
Created February 20, 2011 01:14
Conversion from Launchpad bugs to GitHub ones
#!/usr/bin/env python
"""Launchpad to github bug migration script.
There's a ton of code from Hydrazine copied here:
https://launchpad.net/hydrazine
WARNING: this code was written for the Github issues v2 API, and has *not* been ported to v3. If anyone finds it useful and ports it, please drop me a pull request.
Usage
-----
@drawks
drawks / maketrash.py
Created February 17, 2012 21:53
Really garbagy carbon-cache test bollus generator
#!/usr/bin/env python
import msgpack, socket, time, pickle, struct
from random import shuffle
words = [ word.strip() for word in open('/tmp/word.lst','rt').readlines() ]
def metric_name():
while True:
shuffle(words)
yield ".".join(words[0:3])
# Do a bunch of shit that should only happen at initial setup
# file: cookbooks/foo/recipes/bootstrap.rb
# initial runlist role[foo],recipe[foo::bootstrap]
# useful for downloading an initial codebase of an application
# as opposed to attempting to reinstall each time
ruby_block "remove_bootstrap_recipe" do
block do
Chef::Log.info("Removing foo boostrap from runlist")
node.run_list.remove("recipe[foo::bootstrap]") if node.run_list.include?("recipe[foo::bootstrap]")
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@coderanger
coderanger / __init__.py
Created June 11, 2012 00:57
Edited version of opscode's fabfile/
import os
from fabric.api import env, task, roles, run
from fabric.utils import abort
from chef import ChefAPI, autoconfigure
from chef.fabric import chef_roledefs
if 'OC_USER' in os.environ:
env.user = os.environ['OC_USER']
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@niw
niw / MIT-LICENSE.txt
Created August 25, 2012 12:48
Toggle Host AP Mode on Mac OS X, Using undocumented APIs.
Copyright (C) 2012 Yoshimasa Niwa
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:
@jordansissel
jordansissel / RESULTS.md
Created September 21, 2012 07:41
screenshot + code showing how to query logstash/elasticsearch with a graphite function.

logstash queries graphed with graphite.

Operation: Decouple whisper from graphite.

Method: Create a graphite function that does a date histogram facet query against elasticsearch for a given query string for the time period viewed in the current graph.

Reason: graphite has some awesome math functions. Wouldn't it be cool if we could use those on logstash results?

The screenshot below is using logstash to watch the twitter stream of keywords "iphone" "apple" and "samsung" - then I graph them each, so we get an idea of popularity. As a bonus, I also do a movingAverage() on the iphone curve to show you why this is awesome.