Skip to content

Instantly share code, notes, and snippets.

View shelling's full-sized avatar

shelling shelling

View GitHub Profile
@shelling
shelling / gist:167890
Created August 14, 2009 15:21
auto-complete possible host in ~/.ssh/config
We couldn’t find that file to show.
@shelling
shelling / basic-authenticate.pl
Created August 18, 2009 04:12
basic http authentication example
#!/usr/bin/env perl
use LWP::UserAgent;
use HTTP::Request;
use MIME::Base64;
use YAML qw(LoadFile);
use Data::Dumper;
$config = LoadFile("$ENV{HOME}/.posterous");
@shelling
shelling / tuning-symbol-table.pl
Created August 19, 2009 16:56
modifying symbol table at runtime
#!/usr/bin/evn perl
# this simple script demostrate modifying symbol table at runtime
use 5.010;
package Hello;
sub hello {
"hello";
}
@shelling
shelling / lwpex.pl
Created August 23, 2009 14:58
using LWP with HTTP Basic Authentication
#!/usr/bin/env perl
use LWP::UserAgent;
use HTTP::Request;
use UNIVERSAL::dump;
use XML::Simple;
use Data::Dumper;
use YAML qw(LoadFile);
$config = LoadFile "$ENV{HOME}/.posterous";
#!/usr/bin/env perl
use LWP::UserAgent;
use HTTP::Request;
use UNIVERSAL::dump;
use YAML qw(LoadFile);
package HTTP::Request;
sub authorization_basic {
#!/usr/bin/env perl
use 5.010;
use warnings;
use utf8;
use DBI;
use SQL::Abstract;
use Data::Dumper;
diff --git a/lib/Mojo/Template.pm b/lib/Mojo/Template.pm
index b18ea02..2d81da2 100755
--- a/lib/Mojo/Template.pm
+++ b/lib/Mojo/Template.pm
@@ -88,6 +88,15 @@ sub compile {
my $code = $self->code;
return unless $code;
+ my $c = shift;
+ my $declare_stash;
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
@shelling
shelling / example-ext-test.rb
Created September 2, 2009 17:14
Ruby Extension in "hello, world!"
#!/usr/bin/env ruby
$:.unshift "example.ext"
require "example"
puts Example.new.just_hello
puts Example.new.hello("shelling")
@shelling
shelling / assignment-1.c
Created September 16, 2009 15:55
Equation Set
#include <stdio.h>
/* Question:
** write a program to solve equation set
** ax + by = 1
** cx + dy = 2
** and print the result
*/
int main(void)
{