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 testPerformance($name, Closure $closure, $runs) | |
| { | |
| $start = microtime(true); | |
| for (; $runs > 0; $runs--) | |
| { | |
| $_ = $closure(); | |
| } | |
| $end = microtime(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
| Example |
I hereby claim:
- I am sanmai on github.
- I am sanmai (https://keybase.io/sanmai) on keybase.
- I have a public key ASAEQqjFdv38mOryXsV-joWg1qDmcWwQr5mtqYaih13nDAo
To claim this, I am signing this object:
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
| MAKEFLAGS+=j2 | |
| all: | |
| @echo $(MAKEFLAGS) |
Ниже изменения которые нужно внести в код из статьи.
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
| /* | |
| * dropbox_ext4.c | |
| * | |
| * Compile like this: | |
| * gcc -shared -fPIC -ldl -o libdropbox_ext4.so dropbox_ext4.c | |
| * | |
| * Run Dropbox like this: | |
| * LD_PRELOAD=./libdropbox_ext4.so ~/.dropbox-dist/dropboxd | |
| */ | |
Hey guys,
I have a really terrible hack, but it appears to work, so...
Dropbox calls statfs64 to get the filesystem type. Now, if only there was a way to change its return value to "ext4"... oh wait, there is!
Here's code of the new function: dropbox_ext4.c
/*
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 | |
| if (!function_exists('stats_rand_gen_normal')) { | |
| function stats_rand_gen_normal($mu, $sigma) { | |
| do { | |
| $u = (rand() / getrandmax()) * 2 - 1; | |
| $v = (rand() / getrandmax()) * 2 - 1; | |
| $s = $u * $u + $v * $v; | |
| } while ($s >= 1 || $s == 0); | |
| $multiplier = sqrt(-2 * log($s) / $s); |
We can't make this file beautiful and searchable because it's too large.
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
| 10430,10504,1,1 | |
| 10472,10534,13,2 | |
| 10472,10548,3,3 | |
| 14470,14672,1,4 | |
| 14470,14698,13,5 | |
| 15119,15342,3,6 | |
| 16140,16409,1,7 | |
| 17453,17513,1,8 | |
| 17453,17542,1,9 | |
| 17453,17640,7,10 |