Simple and safe random getters to copy-paste
string randomBytes( int $length )
int randomInt ( int $min , int $max )
string randomUuid ( void )| var PackageLoader = function() { | |
| this.cb = Math.random(0, 100000000000); | |
| this.current = 0; | |
| this.batches = []; | |
| // Load kicks off the entire loading process. | |
| this.load = function(config, loadMap, onload) { | |
| var scope = this; | |
| for(label in loadMap) { | |
| scope.batches.push(new PackageBatch(label, loadMap[label])); |
| <?php | |
| /** | |
| * UUID class | |
| * | |
| * The following class generates VALID RFC 4122 COMPLIANT | |
| * Universally Unique IDentifiers (UUID) version 3, 4 and 5. | |
| * | |
| * UUIDs generated validates using OSSP UUID Tool, and output | |
| * for named-based UUIDs are exactly the same. This is a pure | |
| * PHP implementation. |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| var objA = { | |
| "a" : 1, | |
| "b" : 2 | |
| }, | |
| objB = { | |
| "a" : 3, | |
| "c" : 4 | |
| }; | |
| var updateObj = function (a, b) { |
| function startOfWeek (weekStart) { | |
| var today = new Date(); | |
| var todayInWeek = today.getDay(); | |
| var todayDate = today.getDate(); | |
| var startOfWeekDate = (weekStart == "m") ? | |
| todayDate - (todayInWeek - 1) : todayDate - todayInWeek; | |
| var startOfWeek = new Date(); |
| #!/bin/sh | |
| # | |
| # | |
| # | |
| # To enable this hook, rename this file to "post-commit". | |
| echo "Running Post-Commit hook: Push immediately to master after commits" | |
| # Get current branch | |
| branch=$(git rev-parse --abbrev-ref HEAD) |
| [ | |
| {name: 'Afghanistan', code: 'AF'}, | |
| {name: 'Åland Islands', code: 'AX'}, | |
| {name: 'Albania', code: 'AL'}, | |
| {name: 'Algeria', code: 'DZ'}, | |
| {name: 'American Samoa', code: 'AS'}, | |
| {name: 'AndorrA', code: 'AD'}, | |
| {name: 'Angola', code: 'AO'}, | |
| {name: 'Anguilla', code: 'AI'}, | |
| {name: 'Antarctica', code: 'AQ'}, |