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
if (typeof Object.create !== "function") { | |
Object.create = function (proto) { | |
function Type() { } | |
Type.prototype = proto; | |
return new Type(); | |
}; | |
} | |
function Animal(name) { | |
var self = this; |
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
@@ -176,7 +176,7 @@ all: Wrap return value | |
$__ = new self; | |
if(!is_null($iterator)) $collection = $__->map($collection, $iterator); | |
$collection = (array) $collection; | |
- if(count($collection) === 0) return true; | |
+ if(count($collection) === 0) return self::_wrap(true); | |
return self::_wrap(is_bool(array_search(false, $collection, false))); | |
} | |
@@ -191,8 +191,8 @@ filter: Pass key to iterator |
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
Array | |
( | |
[0] => 5 | |
[1] => 1 | |
[2] => 3 | |
[3] => 0 | |
[4] => 6 | |
[5] => 8 | |
[6] => 4 | |
[7] => 9 |
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
<?php | |
__()->mixin([ | |
"reindex" => function ($items, $indices) { | |
return __($indices)->map(function ($index) use ($items) { return $items[$index]; }); | |
}, | |
"multisort" => function ($items, $keys) { | |
if (count($items) <= 1) { | |
return $items; | |
} |
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
set terminal png size 640,480 | |
set output 'gradient.png' | |
set xrange [-5:5] | |
set yrange [-5:5] | |
set cbrange [0:1] | |
unset colorbox | |
unset key | |
set palette gray negative | |
set object 1 rectangle from 1,-10 to 10,10 behind fillcolor rgb 'black' fillstyle noborder | |
plot '< python gradient.py -x -1 1 -10 10 64' with image |
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
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<configSections> | |
<section name="presidents1" type="System.Configuration.NameValueSectionHandler" /> | |
<section name="presidents2" type="CustomConfig.PresidentListSection, Custom Config" /> | |
</configSections> | |
<presidents1> | |
<add key="1" value="George Washington" /> | |
<add key="2" value="John Adams" /> | |
<add key="3" value="Thomas Jefferson" /> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<appSettings> | |
<add key="Distance" value="10" /> | |
<add key="Timeout" value="1:00" /> | |
</appSettings> | |
</configuration> |
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
<?php | |
function download($url) { | |
$curl = curl_init($url); | |
curl_setopt_array($curl, [ | |
CURLOPT_FOLLOWLOCATION => true, | |
CURLOPT_RETURNTRANSFER => true | |
]); | |
$data = curl_exec($curl); | |
curl_close($curl); | |
return $data; |
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
# Set up repo | |
cvs checkout repo | |
cd repo | |
hg init | |
>> .hgignore echo syntax: glob | |
>> .hgignore echo CVS/* | |
>> .hgignore echo .cvsignore | |
# Consult .cvsignore files | |
hg addremove | |
# Verify pending changes |
OlderNewer