Skip to content

Instantly share code, notes, and snippets.

@earino
earino / gist:2996703
Created June 26, 2012 16:04
Snippet of code using Inline::C and leptonica for super duper fast image resizing
# stuff setting up moose and the environment omitted
sub BUILD {
my $self = shift;
my $application_environment = $ENV{'APPLICATION_ENVIRONMENT'};
my $conf = new Config::General($self->config_file);
my %config = $conf->getall;
anonymous
anonymous / go-template-mode.el
Created January 21, 2012 21:33
Go template mode
;;; go-template-mode.el --- Major mode for Go template language
;;; Commentary:
;; 1) Copy this file somewhere in your Emacs `load-path'. To see what
;; your `load-path' is, run inside emacs: C-h v load-path<RET>
;;
;; 2) Add the following to your .emacs file:
;;
;; (require 'go-template-mode)
@methane
methane / myprofiler.py
Created December 5, 2011 08:54
Casual MySQL profiler using "SHOW FULL PROCESSLIST"
#!/usr/bin/env python
# coding: utf-8
"""myprofiler - Casual MySQL Profiler
https://github.com/methane/myprofiler
"""
import os
import sys
@miyagawa
miyagawa / gist:965935
Created May 11, 2011 04:59
hijack any LWP stack with your PSGI app - it's on CPAN now http://search.cpan.org/~miyagawa/LWP-Protocol-PSGI-0.01/
use strict;
use LWP::UserAgent;
my $app = do {
use Mojolicious::Lite;
get '/' => sub { shift->render(text => "Hello World") };
get '/search' => sub {
my $self = shift;
my $foo = $self->param('q');
$self->render(text => "You searched $foo");