Generate 1GB files quickly (instantly):
dd if=/dev/zero of=test.img bs=1024 count=0 seek=$[1024*1024]
Generate 1GB files with realistic copy delay:
dd if=/dev/zero of=test.img bs=1024 coun=$[1024*1024] seek=0
| <?php | |
| // All these expressions are (bool)true: | |
| count([]) === 0; // Ok, that's expected. | |
| count(true) === 1; // Wait, I can count non-arrays? What does this even mean? | |
| count(false) === 1; // WTF? | |
| count(0) === 1; // yeah, obviously … | |
| count("") === 1; // I'm, starting to see a pattern. |
| ffmpeg -i input.wav -ab 192k -acodec libfaac output.mp4 |
Generate 1GB files quickly (instantly):
dd if=/dev/zero of=test.img bs=1024 count=0 seek=$[1024*1024]
Generate 1GB files with realistic copy delay:
dd if=/dev/zero of=test.img bs=1024 coun=$[1024*1024] seek=0
Extract one specific line with AWK
awk 'NR==40550{print;exit}' <file>Extract line 40550 to 40601:
sed '40602q;40550,40601!d' <file>awk 'NR==40550,NR==40601' <file>Extract line 60451 and 68451:
sed -n '68452q;60451p;68451p' <file>awk 'FNR==60451 || FNR==68451 {print}; FNR==68452 {exit}' | /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user |
| $phi: 1.61803398874989; //"Golden Ratio" | |
| $base-size: 1rem; | |
| @function size($n) { | |
| $size: $base-size; | |
| @if $n > 0 { | |
| @for $i from 1 through $n { | |
| $size: $size * $phi; | |
| } |
| <?php | |
| if (preg_match('/\.(?:png|jpg|jpeg|gif|js|css)$/', $_SERVER["REQUEST_URI"])) { | |
| return false; | |
| } else { | |
| include __DIR__ . '/index.php'; | |
| } |