Skip to content

Instantly share code, notes, and snippets.

Testing

Keybase proof

I hereby claim:

  • I am gwoo on github.
  • I am gwoo (https://keybase.io/gwoo) on keybase.
  • I have a public key whose fingerprint is 1432 AC37 ACC4 0D68 D0DF D2D6 9CAB DA29 7F27 F7A8

To claim this, I am signing this object:

@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

@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 / .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)'
<?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 / 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
@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 / 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: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)
{