Skip to content

Instantly share code, notes, and snippets.

View zdk's full-sized avatar
:octocat:

Di Warachet S. zdk

:octocat:
  • Thailand
  • 15:35 (UTC +07:00)
View GitHub Profile
@zdk
zdk / default.vcl
Created December 16, 2010 05:05
plain varnish configuration
backend default {
.host = "127.0.0.1";
.port = "3000";
}
sub vcl_fetch {
if (req.url == "/esi") {
esi;
}
}
Caught exception in Startsiden::Katalog::Web::Controller::Login->twitter_callback "Can't call method "has_column" on an undefined value at /Users/zdk/perl5/perlbrew/perls/perl-5.12.2/lib/site_perl/5.12.2/Catalyst/Authentication/Credential/Twitter.pm line 117."
Stack Trace
Package Line File Controller::Login 75 /Controller/Login.pm
75: if (my $user = $c->authenticate(undef, 'twitter')) {
76: # user has an account - redirect or do something cool
77: $c->res->redirect("/super/secret/member/area");
78: } else {
Web::Controller::Login->oauth "Parameter oauth_callback_confirmed not valid for a message of type Net::OAuth::RequestTokenResponse at ./perl5/perlbrew/perls/perl-5.12.2/lib/site_perl/5.12.2/Catalyst/Authentication/Credential/OAuth.pm line 113"
Stack Trace
60 Controller/Login.pm
57: sub oauth : Local {
58: my ($self, $c) = @_;
59:
60: if( $c->authenticate( { provider => 'twitter.com' } ) ) {
61: #do something with $c->user
62: }
@zdk
zdk / gist:962153
Created May 9, 2011 06:36
01-usage.t
➜ net-search-katalog git:(master) prove -vwl t/01-usage.t
t/01-usage.t ..
ok 1 - The object isa Net::Search::Katalog::Result
not ok 2
ok 3
# Failed test at t/01-usage.t line 32.
# got: '1244'
# expected: '1242'
ok 4
@zdk
zdk / blackperl.pl
Created May 23, 2011 05:00
blackperl
#/usr/bin/env perl -w
BEFOREHAND: close door, each window & exit; wait until time;
open spell book; study; read (spell, $scan, select); tell us;
write it, print the hex while each watches,
reverse length, write again;
kill spiders, pop them, chop, split, kill them.
unlink arms, shift, wait and listen (listening, wait).
sort the flock (then, warn "the goats", kill "the sheep");
kill them, dump qualms, shift moralities,
@zdk
zdk / ad
Created August 26, 2011 08:43
ad
da_ad_request_done({"userId":"","categoryId":"","keyword":"car","type":"Text","longitude":"10.719191","latitude":"59.993601","customerId":"null","totalResult":"4","items":[{"id":"673650","name":"Kortet som gir drivstoffrabatt hos ","type":"null","landingUrl":"http://adsrv.ads.eniro.com:80/ActionHandler/ActionHandler.jsp?l=aJJRhbvki5sePgV7WR7+1Q==&q=BaU7jC71BW9jambHluUoxsXRA8UtbMogQYgFgW4MqVdsgKux7DZFKefTAlAvleZM0dYgrywj8Sbkjz/HKX/lBRi454MF4oyd14B0+WUVr3rdJ8SrbJLB/6VaNO8AtE4rToe28j2rJzkjk5FPQ0rkxXtcDnJsE6RMZZIdp/LA8EcHwfhsdFkwBpXDPD9nhl17fJWVV10HscT7Eai97QMcMQSzVUIsGyF68pbjGBwwC6Rqi/ULCh7hEr/S6E4yQeUotnoSHTN1p60kHQtUZB3jfifaZsO1mK6+MzFuqq13jEP10TRdonkoXsDOZMeOUoUC0dmlldJzMIwU+th6NepZQAOmCUx5aNS9hYu+ETDUMny70BOHsn2OJbe1sS6e7e+jddm4Q8t4V3R5hHKJOaLHQpVFITatTQTcF5OtNmOStrYGnaHLqEUtOioFYbL09lVAHrL4z3MiGOhCLO+wg0FCf4PBQwgXZ9Vcx+rU+/8Asku2MrenK/oXYHPWHTpH0idg0agfiAAA07QIf/fD4+Pyle9sTi5cPgLTNHFrtBjiAMUir4Qc6jELK0aTDh12CJhmmQuyXDQIhDqmmU9X/gf4FazTFgIrzyfhfoVtQ02tUz8sgPkQQR6ghB34FGeMZVN8jVdwcNXGn2IZRhCkkCTnyPFpfxXVvY+56
@zdk
zdk / build_nginx.sh
Created September 21, 2011 14:42
build_nginx.sh
#!/bin/bash
echo "Downloading... pcre"
sudo curl -OL h ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.13.tar.gz > /usr/local/src/pcre-8.13.tar.gz
echo "Downloading... nginx"
sudo curl -OL h http://nginx.org/download/nginx-1.1.4.tar.gz > /usr/local/src/nginx-1.1.4.tar.gz
echo "Install PCRE"
sudo mkdir -p /usr/local/src
cd /usr/local/src
@zdk
zdk / get_platform
Created October 12, 2011 10:51
get_platform
Stevey's Google Platforms Rant
I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.
I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't really have SREs and they make engi
@zdk
zdk / FizzBuzz.pm
Created October 26, 2011 03:33
FizzBuzz
#FizzBuzz.pm
#!/usr/bin/env perl
package Fizzbuzz;
sub execute {
my $x = shift;
my $m3 = ( $x % 3 ) == 0;
my $m5 = ( $x % 5 ) == 0;
@zdk
zdk / load_yml.pl
Created October 26, 2011 10:18
load_yml.pl
use YAML;
# Load a YAML stream of 3 YAML documents into Perl data structures.
my ($hashref, $arrayref, $string) = Load(<<'...');
error_handler:
actions:
# Note that Email is only provided here as an example, it does not
# exist.
- type: Email
id: email-devel
to: andreas@example.com