Skip to content

Instantly share code, notes, and snippets.

@gwoo
gwoo / gist:51134
Created January 23, 2009 18:55 — forked from mdarby/gist:43115
$this->User->id = 121;
$this->User->saveField('last_login', date('Y-m-d g:i:s'));
OAuth realm="",oauth_consumer_key="GKVVBADbbJ7g0gR1MFdog", oauth_nonce="829a883fa0a11ff849b013de1fef5c8b0cae5e5b", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1265944607", oauth_version="1.0", oauth_signature="1Y4mMORCJf2kEFMS5MPWyxQIqPM%3D",
@gwoo
gwoo / gist:3024797
Created June 30, 2012 17:41
ReflectionFilter
<?php
namespace moneygram\extensions\imagine;
class ReflectionFilter implements \Imagine\Filter\FilterInterface
{
private $imagine;
public function __construct(\Imagine\Image\ImagineInterface $imagine)
{
@gwoo
gwoo / LearningAngular.txt
Last active March 15, 2016 20:26
Learning Angular
## Angular modules
http://ngmodules.org/
http://angular-ui.github.com/
http://angular-ui.github.com/bootstrap/
## Angular resources
John Lindquist Videos:
http://egghead.io
@gwoo
gwoo / gist:4141670
Created November 24, 2012 22:34
filter for Media::encode arrays.
Media::applyFilter('encode', function($self, $params, $chain) {
foreach ($params['data'] as $key => $value) {
if ($value instanceof \lithium\data\Collection) {
$params['data'][$key] = array_values($value->to('array'));
}
}
return $chain->next($self, $params, $chain);
});
@gwoo
gwoo / git_prompt.sh
Created November 28, 2012 21:17
add git info to terminal prompt
parse_git_path() {
repo=$(git rev-parse --git-dir 2>/dev/null)
if [ -n $repo ]
then
repo=$(echo $repo | sed 's/.git$//')
if [ -z $repo ]
then
repo=$PWD
else
home=$HOME
<?php
namespace app\tests\cases\controllers;
use app\controllers\UsersController;
use app\models\Users;
use lithium\action\Request;
use lithium\data\Connections;
class UsersControllerTest extends \lithium\test\Integration {
@gwoo
gwoo / .gitconfig
Created July 25, 2013 04:55
~/.gitconfig
[alias]
co = checkout
st = status
up = pull --rebase
chp = cherry-pick
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --
latest = for-each-ref --sort=-committerdate --format='%(committerdate:short) %(refname:short)'
@gwoo
gwoo / gmon-install.sh
Last active December 28, 2015 19:29
Install GMon on Linux.
#!/usr/bin/env bash
cd /usr/bin
rm gmon-linux-amd64 gmon
curl -C - -O -L -k github.com/gwoo/gmon/releases/download/v0.2/gmon-linux-amd64
chmod a+x /usr/bin/gmon-linux-amd64
ln -s /usr/bin/gmon-linux-amd64 /usr/bin/gmon
touch /etc/gmon.json
@gwoo
gwoo / perf-tests.md
Last active December 30, 2015 05:09
AWS vs DO perf tests.

Tests

disk: dd if=/dev/zero of=test bs=64k count=16k conv=fdatasync; unlink test

disk seek: ioping -R <volume>

network: wget -O /dev/null http://cachefly.cachefly.net/100mb.test

AWS Small EBS