Skip to content

Instantly share code, notes, and snippets.

(defun xcode-buildandrun ()
(interactive)
(do-applescript "tell application \"Xcode\"
activate
end tell
tell application \"System Events\"
key code 15 using {command down}
end tell"))
@rurban
rurban / Jit-nt-simple.xs
Created March 14, 2010 08:54
perl5 x86 runloop jitting
/* Jit-nt.xs: no threads, no JUMPTABLE
*
* Copyright (C) 2010 by Reini Urban
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
*
* http://gist.github.com/331867
*/
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@uasi
uasi / fastpack.sh
Created April 30, 2010 19:42
fastpack - a simple App::FatPacker helper
#!/bin/sh
#
# fastpack - a simple App::FatPacker helper
#
if [ -z "$1" ]; then
echo "usage: fastpack script.pl > script.packed.pl"
exit 0
fi
diff --git a/lib/Plack/App/WrapCGI.pm b/lib/Plack/App/WrapCGI.pm
index 7f0a7a7..925b2e9 100644
--- a/lib/Plack/App/WrapCGI.pm
+++ b/lib/Plack/App/WrapCGI.pm
@@ -2,7 +2,7 @@ package Plack::App::WrapCGI;
use strict;
use warnings;
use parent qw(Plack::Component);
-use Plack::Util::Accessor qw(script _app);
+use Plack::Util::Accessor qw(script run_on_shell _app);
from google.appengine.ext import webapp
def _adjust_path_info(script_path, environ):
if environ["PATH_INFO"].startswith(script_path):
environ["SCRIPT_NAME"] += script_path
environ["PATH_INFO"] = environ["PATH_INFO"][len(script_path):]
def as_handler(wsgi):
class WSGIHandler(webapp.RequestHandler):
#!/usr/bin/env perl
use strict;
use warnings;
# Usage: cpan-outdated -v | diffchanges.pl
use LWP::UserAgent;
use Algorithm::Diff;
my $ua = LWP::UserAgent->new;
package Plack::Middleware::Parallel::Scoreboard;
use strict;
use warnings;
use parent qw(Plack::Middleware);
use Plack::Util::Accessor qw(board base_dir path);
use Parallel::Scoreboard;
our $VERSION = '0.01';
sub prepare_app {
my $self = shift;
#!/usr/bin/perl
use strict;
use warnings;
use MozRepl;
use Net::Pcap::Easy;
my ($ustream_url, $file, $stop, $device) = @ARGV;
my $usage = <<USAGE;
package Plack::Middleware::Random;
use strict;
use warnings;
use parent qw(Plack::Middleware);
use POSIX qw(floor);
my $known_requests = [];
sub call {