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
$locations_with_children=[]; | |
foreach($locations as $location) { | |
$locations_with_children[$location->parent_id] = true; | |
} | |
public static function indenter($locations, $locations_with_children, $parent_id = null, $prefix = '') { | |
$results = Array(); | |
foreach($locations as $location) { | |
$locations_with_children[$location->parent_id] = 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
function indenter($locations, $parent_id = null, $prefix = '') { | |
$results = Array(); | |
foreach($locations as $location) { | |
if($location->parent_id == $parent_id) { | |
//append this parent node first, | |
$location->use_text = $prefix.' '.$location->name | |
$results[] = $location; | |
//now append the children. | |
$results = array_merge($results,indenter($locations,$location->id,$prefix.'--')); | |
} |
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
function indenter($locations, $parent_id = null, $prefix = '') { | |
$results = Array(); | |
foreach($locations as $location) { | |
if($location->parent_id == $parent_id) { | |
//append this parent node first, | |
$results[] = [ | |
'id' => $location->id, | |
'text' => $prefix.' '.$location->name, | |
'image' => $location->image |
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 | |
$config = [ | |
/* | |
|-------------------------------------------------------------------------- | |
| Default Filesystem Disk | |
|-------------------------------------------------------------------------- | |
| | |
| Here you may specify the default filesystem disk that should be used |
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 ruby | |
a=[] | |
1_000_000.times do |what| | |
a.concat ["froopty@blorp.norb#{what}"] | |
p "ten thousand: #{what}" if what % 10_000 == 0 | |
end | |
p "A length is: #{a.count}" | |
p a |
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 ruby | |
a=[] | |
1_000_000.times do |what| | |
a<< "froopty@blorp.norb#{what}" | |
p "ten thousand: #{what}" if what % 10_000 == 0 | |
end | |
p "A length is: #{a.count}" | |
p a |
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 ruby | |
# a=[] | |
require 'tempfile' | |
f=Tempfile.open | |
1_000_000.times do |what| | |
# a+=["froopty@blorp.norb"] | |
f.write("froopty@blorp.norb#{what}\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 | |
$arr=[]; | |
for($i=0;$i<1000000;$i++) { | |
$arr[]="poopiedoop@fart.nuckle"; | |
} | |
print count($arr); |
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 ruby | |
a=[] | |
1_000_000.times do |what| | |
a+=["froopty@blorp.norb"] | |
end | |
p "A length is: #{a.count}" |
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
const co = require('co') | |
function gen () { | |
console.warn('Beginning wait for gen') | |
return (callback) => { | |
setTimeout( () => { | |
console.warn("waiting finished for 'gen'") | |
callback(null,7) | |
},2000) | |
} |
NewerOlder