Skip to content

Instantly share code, notes, and snippets.

View gabrielfalcao's full-sized avatar
👨‍💻
probably writing tests

Gabriel Falcão gabrielfalcao

👨‍💻
probably writing tests
View GitHub Profile
#!/bin/sh
# Adium theme AdiumMessageStyle installer for Empathy
# Originally © 2009 Antono Vasiljev
# Licensed under the same terms as Empathy
# http://antono.info/en/165-install-adium-themes-to-empathy
# Changed by Vertlo Oraerk (did not work with directories containing spaces in the names)
if [ -z $1 ]
then
echo
#!/usr/bin/ruby
#
# I deliberately didn't DRY /usr/local references into a variable as this
# script will not "just work" if you change the destination directory. However
# please feel free to fork it and make that possible.
#
# If you do fork, please ensure you add a comment here that explains what the
# changes are intended to do and how well you tested them.
#
# 14th March 2010:
Feature: Twitter login
As a registred user
I want use my twitter account
So that I can get personal data
Scenario: Authenticate
Given my username pytwitt2
And my secret password 123456
When I request for access
Then my user pytwitt2 object should be returned
import logging
import os
# Add appengine stuff to path
import dev_appserver as script
script.fix_sys_path()
from google.appengine.api import yaml_errors
from google.appengine.tools import dev_appserver
from google.appengine.tools import dev_appserver_main as main
#!/usr/bin/env python
from twisted.internet import reactor
from twisted.web import proxy, server
from twisted.web.resource import Resource
class ProxyResource(Resource):
def getChild(self, path, request):
request.received_headers['x-forwarded-host'] = request.received_headers['host']
@gabrielfalcao
gabrielfalcao / .gitignore
Created February 1, 2012 04:05 — forked from azisaka/.gitignore
Creates to do lists on Basecamp
*.pyc
#!/usr/bin/env python
import argparse
import gitlab3
import io
import os
import sys
def parse_command_line_arguments(args):
parser = argparse.ArgumentParser(description='Manage GitLab deploy keys')

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

import boto.vpc
import time
REGION_NAME = 'us-west-2'
AMI_ID = 'ami-8e27adbe' # Amazon Linux AMI
conn = boto.vpc.connect_to_region(REGION_NAME)
# Create a VPC
vpc = conn.create_vpc('10.0.0.0/16')
In [1]: policy = """{
...: "Statement":[{
...: "Effect":"Allow",
...: "Action":["s3:*"],
...: "Resource":["arn:aws:s3:::mybucket"]}]}"""
In [2]: import boto
In [4]: c = boto.connect_iam()
In [5]: instance_profile = c.create_instance_profile('myinstanceprofile')
In [6]: role = c.create_role('myrole')
In [7]: c.add_role_to_instance_profile('myinstanceprofile', 'myrole')