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 | |
| // Define the 'class' class | |
| $class = Obj() | |
| ->fn('new', function ($class) { | |
| $newClass = Obj($class->methods) | |
| ->fn('new', function($class) { | |
| $obj = Obj($class->imethods); | |
| $args = func_get_args(); | |
| array_shift($args); |
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
| # require 'ap' | |
| def months_between(d1, d2) | |
| (d2.year * 12 + d2.month) - (d1.year * 12 + d1.month) | |
| end | |
| today = Date.today | |
| first = (today - 10.weeks).beginning_of_month | |
| last = today.end_of_month |
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
| require "set" | |
| class Batch | |
| def initialize(results = {}, &blk) | |
| @ids = ::Set.new | |
| @blk = blk | |
| @promises = {} | |
| @results = results | |
| end |
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 main | |
| import ( | |
| "fmt" | |
| "image" | |
| "math" | |
| "os" | |
| "sync" | |
| "github.com/disintegration/gift" |
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
| require "formula" | |
| class Hiptext < Formula | |
| homepage "https://github.com/jart/hiptext" | |
| head "https://github.com/jart/hiptext.git", :branch => "master" | |
| depends_on "pkg-config" => :build | |
| depends_on "ragel" => :build | |
| # depends_on :libpng | |
| depends_on "jpeg" |
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
| Learn tab in launcher, free examples. | |
| moving camera: | |
| l+r at same time | |
| Hold right, + wasd+qe move camera | |
| fog: quickest way to get a basic background | |
| light: atmosphere option -> sun |
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 | |
| // Find files of all classes loaded.. | |
| $loader = require('vendor/autoload.php'); | |
| $files = array_filter(array_map(function($c) use ($loader) { | |
| return $loader->findfile($c); | |
| }, get_declared_classes())); | |
| // Better solution.. find all required files | |
| array_map(function($f) use ($i) { |
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 | |
| function wilson($p, $n) { | |
| $z = 1.9599; | |
| $z2 = pow($z, 2); | |
| return array( | |
| ($p + $z2/(2*$n) - $z * sqrt(($p*(1-$p) + $z2/(4*$n)) / $n)) / (1 + $z2/$n), | |
| ($p + $z2/(2*$n) + $z * sqrt(($p*(1-$p) + $z2/(4*$n)) / $n)) / (1 + $z2/$n), | |
| ); |
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 | |
| // Parse HTTP HOST header hostname and port according to http://tools.ietf.org/html/rfc3986.html | |
| $h16 = '[[:xdigit:]]{1,4}'; | |
| $subDelims = "[!$&'()*+,;=]"; | |
| $pctEncoded = '%[[:xdigit]][[:xdigit]]'; | |
| $unreserved = '[-._~[:alpha:][:digit:]]'; | |
| $decOctet = <<<EOS | |
| (?: |
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
| diff --git a/lib/Pheasant/DomainObject.php b/lib/Pheasant/DomainObject.php | |
| index 41a103c..be04890 100755 | |
| --- a/lib/Pheasant/DomainObject.php | |
| +++ b/lib/Pheasant/DomainObject.php | |
| @@ -65,9 +65,9 @@ class DomainObject | |
| * Used by the default initialize() method, returns the table name to use | |
| * @return string | |
| */ | |
| - public function tableName() | |
| + public static function tableName() |
NewerOlder