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
<snippet> | |
<content><![CDATA[ | |
die(var_dump(\$${1:this})); | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>dd</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<scope>source.php</scope> | |
</snippet> |
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 | |
use Illuminate\Support\Arr; | |
function array_multi_search(array $array, $key) | |
{ | |
if (!is_string($key)) { | |
return false; | |
} |
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
#!/bin/bash | |
function usage() | |
{ | |
printf "Usage:\n\n" | |
printf "./merge_branches.sh <branch>\n\n" | |
} | |
if [ "$1" == "" ]; then | |
usage |
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
#!/bin/bash | |
function usage() | |
{ | |
printf "Usage:\n\n" | |
printf "./delete_merged_branches <branch>\n\n" | |
} | |
if [ "$1" == "" ]; then | |
usage |
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 | |
for ($i = 1; $i < 200; $i++) { | |
$a = load($i); | |
echo "You have allocated {$i}M (".memory_get_usage().") memory in this php script\n"; | |
unset($a); | |
} | |
function load($i) |
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
#!/bin/bash | |
echo "Enter number to be converted: " | |
read no | |
echo "Converting $no from decimal to binary (base2)" | |
no=`echo "obase=2;$no" | bc` | |
echo Binary: $no | |
echo "Converting binary($no) to decimal" | |
no=`echo "obase=10;ibase=2;$no" | bc` |
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
3 | |
2 | |
4 | |
6 | |
5 | |
7 | |
8 | |
0 | |
1 |
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
f :: [Int] -> [Int] | |
f lst = map ((!!)lst) [1,3..length lst-1] | |
-- This part deals with the Input and Output and can be used as it is. Do not modify it. | |
main = do | |
inputdata <- getContents | |
mapM_ (putStrLn. show). f. map read. lines $ inputdata |
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
f :: Int -> [Int] -> [Int] | |
f n arr = concatMap (replicate n) arr | |
-- This part handles the Input and Output and can be used as it is. Do not modify this part. | |
main :: IO () | |
main = getContents >>= | |
mapM_ print. (\(n:arr) -> f n arr). map read. words |