Skip to content

Instantly share code, notes, and snippets.

View ao's full-sized avatar
😶‍🌫️

Andrew O ao

😶‍🌫️
View GitHub Profile
@meeDamian
meeDamian / shorten.php
Created December 20, 2011 08:39
[ PHP | api | google ] goo.gl link shortenter
<?
// add it to config file:
$google_key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
// add this to libs file:
function shorten($url) {
$gurl = "https://www.googleapis.com/urlshortener/v1/url?key=" . $GLOBALS['google_key'];
$url = json_encode(array("longUrl" => $url));
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
@DarrenN
DarrenN / stop_words.txt
Created January 29, 2011 22:02
Naively parse a text removing stopwords
'tis
'twas
a
aah
aaron
abandon
abandoned
abbott
abby
abe
@guenter
guenter / move_to_rds.rb
Created November 11, 2010 02:14
A quick and dirty script to move a database into Amazon RDS (or any other database). Can transfer part of the data beforehand.
require 'fileutils'
start_time = Time.now
SOURCE_DB = {
:name => 'db_name',
:user => 'db_user',
:password => 'db_pass',
:host => 'localhost'