This file contains hidden or 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
| class git { | |
| package { 'git': | |
| ensure => installed, | |
| } | |
| define repository($project = $name, $cwd, $dir = "$cwd/${project}", | |
| $repo = "githost:${project}.git", $no_ensure = 0) { | |
| $require = $no_ensure ? { | |
| 1 => [Package['git']], | |
| default => [Package['git'], File[$cwd]], |
This file contains hidden or 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
| class Range | |
| def overlaps(range) | |
| Sequel::SQL::PlaceholderLiteralString.new( | |
| "(?, ?) OVERLAPS (?, ?)", | |
| [ | |
| self.first, self.end, | |
| range.first, range.end | |
| ], | |
| true | |
| ) |
This file contains hidden or 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
| <?php | |
| class Model { | |
| /* public Model->load(Integer) | |
| * returns $this | |
| * | |
| * Pulls data from the database for a given model into the object. Note | |
| * that this clears any state (modifications/etc.) that have been set | |
| * on the object first, for any Model-controlled columns. |
This file contains hidden or 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
| CREATE TABLE users ( | |
| phone_number TEXT | |
| UNIQUE | |
| NOT NULL, | |
| first_name TEXT, | |
| last_name TEXT, | |
| username TEXT | |
| NOT NULL, | |
| PRIMARY KEY (phone_number) |
This file contains hidden or 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 PLModel::Accessor; | |
| use warnings; | |
| use strict; | |
| sub TIESCALAR { | |
| my ($class) = shift; | |
| my ($curval, $colname, $object) = @_; | |
| return bless({ |
This file contains hidden or 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 $app = sub { | |
| my ($status) = 200; | |
| my ($headers) = [ 'Content-type' => 'text/plain' ]; | |
| my ($body) = [ "SUP YOU GUYS\n", "IT'S MEEEEEEE\n" ]; | |
| return [$status, $headers, $body]; | |
| }; | |
| use Plack::Builder; | |
| builder { $app } |
This file contains hidden or 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 v5.14; | |
| use warnings; | |
| use File::Spec; | |
| use IO::File; | |
| use autodie; | |
| my ($dir); |
This file contains hidden or 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 v5.14; | |
| use warnings; | |
| package PackageA { | |
| # put subs in here and then coderefs passed to PackageA->configure() can use these methods | |
| # as though they're in the right package | |
| package PackageA::ConfigurationSubs { | |
| sub hello { | |
| say "hello, world"; | |
| } |
This file contains hidden or 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
| >>> perl -MO=Concise,-exec crazier.pl | |
| 1 <0> enter | |
| 2 <;> nextstate(main 66 crazier.pl:4) v:%,*,&,{,$,2048 | |
| 3 <{> enterloop(next->8 last->8 redo->4) v | |
| 4 <;> nextstate(PackageA 51 crazier.pl:7) v:%,*,&,{,$,2048 | |
| 5 <{> enterloop(next->7 last->7 redo->6) v | |
| 6 <0> stub v | |
| 7 <2> leaveloop vK/2 | |
| 8 <2> leaveloop vK/2 | |
| 9 <;> nextstate(main 69 crazier.pl:41) v:%,*,&,{,$,2048 |
This file contains hidden or 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
| def event(queuename, *nums) | |
| puts "Got event for #{queuename}!" | |
| puts " nums: #{nums.join(', ')}" | |
| end | |
| begin | |
| while line = $stdin.readline | |
| args = line.chomp.split(/\s+/) | |
| 1.upto(args.length - 1) { |x| args[x] = args[x].to_i } |