Skip to content

Instantly share code, notes, and snippets.

View tisba's full-sized avatar
🚀
Perf Testing all the Things!

Sebastian Cohnen tisba

🚀
Perf Testing all the Things!
View GitHub Profile
#!/usr/bin/env bash
# add partner sources
echo -e "deb http://archive.canonical.com/ubuntu lucid partner \n\
deb-src http://archive.canonical.com/ubuntu lucid partner" >> /etc/apt/sources.list
# update package list
apt-get update
# read and accept the agreement
/*
proxy with pooling
Copyright (c) 2010 Mikeal Rogers
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
@okiess
okiess / Gemfile
Created April 9, 2012 10:05
Simple ODM for AvocadoDB
source "http://rubygems.org"
gem 'httparty'
gem 'json'
group :development do
gem "shoulda", ">= 0"
gem "bundler", "~> 1.0.0"
gem "jeweler", "~> 1.6.4"
gem "rcov", ">= 0"
end
@tisba
tisba / a.md
Created June 29, 2012 08:09 — forked from rkh/a.md

This allows you to use the following video streaming services outside of the US from your Mac without having to use a proxy or VPN, so no big bandwidth issues:

  • Netflix
  • Hulu / HuluPlus
  • CBS
  • ABC
  • MTV
  • theWB
  • CW TV
  • Crackle
from lxml import etree
from copy import deepcopy
from math import ceil
itemsPerPage = 10
for inFile in ["episodes.all.m4a.rss", "episodes.all.mp3.rss"]:
xmlData = etree.parse(inFile)
@DonSchado
DonSchado / example_spec.rb
Last active December 22, 2015 20:18
Thoughtbot retracted their initial implementation of strong parameters matchers in v2.0.0 of shoulda-matchers, so we decided to build our own until new official ones are released. The following is a small matcher for testing what params should be permitted in controllers. The matcher's syntax is based on validation matchers. If you're not follow…
# assuming your subject is the UsersController with a method user_params
describe UsersController do
describe "params" do
# per default the matcher extracts the subject and params method
it { should permit_params(:email, :name, :role) }
# to overwrite the params method use explicit .params_method()
it { should permit_params(:first_name, :last_name).params_method(:other_user_params) }
@Jach
Jach / mig.py
Created December 30, 2011 04:09
Dirty migration script from Jira issues to Github issues
'''
Steps:
1. Create any milestones
2. Create any labels
3. Create each issue, linking them to milestones and labels
3.1: Update status for new issue if closed
4: Create all the comments for each issue
'''
import getpass
import json
@avdi
avdi / gol.exs
Last active June 3, 2016 04:30
Game of life in Elixir (take 1)
defmodule Life do
def run(board) when is_binary(board) do
board |> parse_board |> run
end
def run(board) do
IO.write("\e[H\e[2J")
Life.print_board board
:timer.sleep 1000
board = next_board(board)
@judofyr
judofyr / fizzbuzz.rb
Created August 1, 2012 21:37 — forked from JEG2/fizzbuzz.rb
Writing FizzBuzz with flip-flops
a=b=c=(1..100).each do |num|
print num, ?\r,
("Fizz" unless (a = !a) .. (a = !a)),
("Buzz" unless (b = !b) ... !((c = !c) .. (c = !c))),
?\n
end
@nomicode
nomicode / export_chat.py
Last active October 31, 2018 19:06
Export chat logs from Messages.app
#!/usr/bin/env python
import sys
import urllib
import urlparse
import base64
import mimetypes
import cgi
from os import path