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 ruby | |
require "init" | |
p = Post.new | |
p.title = "first" | |
p.content = "hello world, this is my first entity" | |
p.save |
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
package MyApp::DB; | |
my $dsn = "dbi:SQLite:dbname=test.sqlite3"; | |
sub driver { | |
my $class = shift; | |
my $mode = shift; | |
if ($mode == "default") { | |
Data::Model::Driver::DBI->new( dsn => $dsn ); | |
} |
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 ruby | |
require 'rubygems' | |
require 'osx/cocoa' | |
app = OSX::NSApplication.sharedApplication | |
window = OSX::NSWindow.alloc.initWithContentRect_styleMask_backing_defer( | |
[0,0,500,500], | |
OSX::NSTitledWindowMask + OSX::NSClosableWindowMask, |
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 guile | |
!# | |
(write '(a . (b c)))(newline) |
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
;; (define push | |
;; (lambda (array scalar) | |
;; '(array . scalar))) | |
(define puts | |
(lambda (text) | |
(display text)(newline))) | |
(define print | |
(lambda (content) |
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 | |
package User; | |
use Jifty::DBI::Schema; | |
use Jifty::DBI::Record schema { | |
column name => | |
type is "text", | |
label is "Name", | |
render as "text"; |
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
<% my $person = "johnny" %> | |
person is <%= $person %> | |
<%= $var_out %> |
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 5.010; | |
package Hello; | |
our $var = "scalar"; | |
our @var = qw(array); |
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 Data::Dumper; | |
use 5.010; | |
BEGIN { | |
for my $tag (qw(html body table)) { | |
eval qq{ | |
sub $tag (&) { | |
"<$tag>" . shift->() . "</$tag>"; |
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 5.010; | |
say "Content-Type: text/html; charset=ISO-8859-1"; | |
say; | |
say "hello, world! This is a cgi without CGI"; |