Skip to content

Instantly share code, notes, and snippets.

@cakebaker
cakebaker / OAuthClient.php
Created July 11, 2014 15:16
Adds a request() method to the OAuthClient
<?php
/**
* A simple OAuth client class for CakePHP.
*
* Uses the OAuth library from http://oauth.googlecode.com/svn/code/php/
*
* Copyright (c) by Daniel Hofstetter (http://cakebaker.42dh.com)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
@cakebaker
cakebaker / gist:823574
Created February 12, 2011 07:11
Nicer interface for removing query string params with Node.js
var urlLib = require('url');
function UrlAdapter(urlString) {
this.urlObj = urlLib.parse(urlString, true);
// XXX remove the search property to force format() to use the query object when transforming the url object to a string
delete this.urlObj.search;
}
exports.UrlAdapter = UrlAdapter;
@cakebaker
cakebaker / nom.js
Created February 4, 2010 14:27 — forked from voodootikigod/nom.js
var http = require("http"),
sys = require("sys");
function read(callback) {
connection = http.createClient(8000, "127.0.0.1");
var request = connection.request("/index");
request.finish(function (response) {
var responseBody = "";
response.setBodyEncoding("utf8");
response.addListener("body", function(chunk) {
responseBody += chunk;
@cakebaker
cakebaker / gist:89069
Created April 2, 2009 07:15
CakePHP shell script to run NoseRub's migrations
<?php
/**
* A simple shell script to run NoseRub's migrations.
*
* Requires the Migration model from NoseRub (http://noserub.com) and a
* folder app/config/sql/migrations for the migrations.
*
* Copyright (c) by Daniel Hofstetter (http://cakebaker.42dh.com)
*
* Licensed under The MIT License
@cakebaker
cakebaker / fou.rb
Created March 1, 2009 15:48
A simple Ruby script to follow/unfollow twitter users from the command line
#
# fou (follow or unfollow) is a simple script which allows you to
# follow/unfollow twitter users from the command line.
#
# Copyright (c) by Daniel Hofstetter (http://cakebaker.42dh.com)
#
# Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php
# Redistributions of files must retain the above copyright notice.
#