This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTML = Object clone | |
Association = Object clone | |
a -> b := Association clone do: { from = a; to = b } | |
Self-Closing = ["base", "meta", "link", "hr", "br", "param", "img", "area", "input", "col", "frame"] | |
-- creating elements with no content | |
-- keyword dispatch adds attributes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use 5.10.1; | |
use strict; | |
use warnings; | |
use HTTP::Request::Common 'POST'; | |
use AnyEvent::HTTP; | |
use Benchmark; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Protos AssertionException := Exception clone | |
Object do( | |
assert := method(v, m, | |
if(true != v, | |
m ifNil(m = "true != (#{ call argAt(0) })" interpolate) | |
AssertionException raise(m) | |
) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'rack' | |
class Object | |
def webapp | |
class << self | |
define_method :call do |env| | |
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?) | |
[200, {}, send(func, *attrs)] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assuming this directory structure: | |
# | |
# MyModule/ | |
# init.io # => Object clone do( foo := "bar" ) | |
# slot1.io # => "LOL" | |
# slot2.io # => method("running slot2" println; self) | |
# slot3/ | |
# subslot1.io # => "this is subslot1" | |
import("/path/to/MyModule") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
use EV; | |
use AnyEvent; | |
# Simple delayed rendering | |
get '/' => sub { | |
my $self = shift; | |
my $w; | |
$w = AE::timer 3, 0, sub { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 0 is too far from ` ;) | |
set -g base-index 1 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi | |
set -g history-limit 10000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax on | |
filetype on | |
filetype plugin indent on | |
let perl_include_pod = 1 | |
let perl_extended_vars = 0 | |
let perl_want_scope_in_variables = 1 | |
let perl_fold = 1 | |
let perl_fold_blocks = 1 | |
set foldenable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
BEGIN { | |
package Acme::Constructor::Pythonic; | |
no thanks; | |
use Data::OptList qw(mkopt); | |
use Sub::Install qw(install_sub); | |
use Module::Runtime qw(use_module); | |
sub import { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use LWP::Simple; | |
sub pick { $_[rand @_] } | |
my $text = get "https://gist.github.com/shanselman/5422230/raw/9863d88bde2f9dcf6b2e7a284dd4a428afdc8c8b/gistfile1.txt"; | |
my @samples = split /\|\n/, $text; | |
my $template = pick @samples; |
OlderNewer