Skip to content

Instantly share code, notes, and snippets.

View mikegreiling's full-sized avatar

Mike Greiling mikegreiling

View GitHub Profile
@baranga
baranga / path_segment_encode.php
Created October 9, 2012 08:27
sample implementation of path segment encode with benchmark
<?php
class PathSegmentEncode
{
/**
* Map of allowed special chars in path segments.
*
* http://tools.ietf.org/html/rfc3986#appendix-A
* segement = *pchar
* pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
#!/bin/bash
OPSWORKS_USERDATA_LOG_FILE='/var/log/aws/opsworks/user-data.log'
export OPSWORKS_USERDATA_LOG_FILE
mkdir -p $(dirname ${OPSWORKS_USERDATA_LOG_FILE})
touch ${OPSWORKS_USERDATA_LOG_FILE} && chmod 0600 ${OPSWORKS_USERDATA_LOG_FILE}
exec &> >(tee -a ${OPSWORKS_USERDATA_LOG_FILE}) 2>&1
conslog () {
echo "[$(date --rfc-2822)] opsworks-init: $1" | tee -a ${OPSWORKS_USERDATA_LOG_FILE} > /dev/console
@mikegreiling
mikegreiling / StripeTutorialPage.html
Created October 11, 2012 05:02 — forked from boucher/StripeTutorialPage.html
Stripe Tutorial Payment Form
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
// this identifies your website in the createToken call below
@Leechael
Leechael / WeiboController.php
Created January 25, 2011 05:23
The weibo oauth processing controller with li3_oauth.
<?php
namespace app\controllers;
use lithium\net\http\Router;
use lithium\storage\Session;
use li3_oauth\models\Consumer;
class WeiboController extends \lithium\action\Controller {
@samir
samir / gist:707798
Created November 20, 2010 12:51
Base for create .bash_profile for OS X
# --------------------------------------------------------
export APXS2=`which apxs`
export CFLAGS="-arch x86_64 -O2"
export ARCHFLAGS="-arch x86_64"
export EDITOR='mate -w'
export CLICOLOR=1
export TERM=xterm-color
export LSCOLORS=DxGxcxdxCxegedabagacad
export LC_CTYPE=en_US.UTF-8