Simple and safe random getters to copy-paste
string randomBytes( int $length )
int randomInt ( int $min , int $max )
string randomUuid ( void )| #!/bin/bash | |
| # RESULTS, feel free to repro yourself | |
| # | |
| # noLock FAIL | |
| # accessShare FAIL | |
| # rowShare FAIL | |
| # rowExclusive FAIL | |
| # shareUpdateExclusive SUCCESS | |
| # share FAIL+DEADLOCKS | |
| # shareRowExclusive SUCCESS | 
| <?php | |
| /** | |
| * Shit for handling IPv6 & mysql storage, @gsphpdev | |
| * Bloody headache... remember this Gavin! | |
| */ | |
| /** | |
| * Only PHP 5.4+ has this function so need to add one if not | 
| # Only listen on http; disable ajp and https | |
| web: java -jar jenkins.war --httpPort=$PORT --ajp13Port=-1 --httpsPort=-1 | 
| username: vagrant | |
| password: vagrant | |
| sudo apt-get update | |
| sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev | |
| sudo aptitude install mysql-server mysql-client | |
| sudo nano /etc/mysql/my.cnf | 
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, | 
| -Dawt.useSystemAAFontSettings=lcd | |
| -Dswing.aatext=true | 
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
| <!-- | |
| <form autocomplete="off"> will turn off autocomplete for the form in most browsers | |
| except for username/email/password fields | |
| --> | |
| <form autocomplete="off"> | |
| <!-- fake fields are a workaround for chrome/opera autofill getting the wrong fields --> | |
| <input id="username" style="display:none" type="text" name="fakeusernameremembered"> | |
| <input id="password" style="display:none" type="password" name="fakepasswordremembered"> | |
| /* | |
| Demo: https://jsfiddle.net/elky/f6khaf2t/ | |
| <div class="element"> | |
| <div class="truncate"> | |
| Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt | |
| ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco | |
| laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in | |
| voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat | |
| non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |