I hereby claim:
- I am niksmac on github.
- I am niksmac (https://keybase.io/niksmac) on keybase.
- I have a public key ASDIN9pUfXhvZO_R2C2Co5XPM8HjOBrfznFX0WD80TDEVwo
To claim this, I am signing this object:
| cache_get() returns $cache objects even if the cached item is stale (expired) | |
| function custom_fn_get_data() { | |
| // Return the cached data | |
| $cache = cache_get('custom:fn_get_data'); | |
| if (!$cache) { | |
| // Some expensive processing to build the data. | |
| $data = complicated_recursion_and_loops_on_lots_of_data(); | |
| // Cache the data and rebuild it every hour |
| Location module has the function location_distance_between() (also in D7). | |
| It passes the call on to function earth_distance($longitude1, $latitude1, $longitude2, $latitude2), which lives inside the earth.inc file in the same package. | |
| See also: http://en.wikipedia.org/wiki/Great-circle_distance, which points out some of the intricacies of numerical calculation and accuracy of long vs short distances. |
| { | |
| "vars": { | |
| "@gray-base": "#000", | |
| "@gray-darker": "lighten(@gray-base, 13.5%)", | |
| "@gray-dark": "lighten(@gray-base, 20%)", | |
| "@gray": "lighten(@gray-base, 33.5%)", | |
| "@gray-light": "lighten(@gray-base, 46.7%)", | |
| "@gray-lighter": "lighten(@gray-base, 93.5%)", | |
| "@brand-primary": "darken(#428bca, 6.5%)", | |
| "@brand-success": "#5cb85c", |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title>Site Maintenance</title> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <style> | |
| body { text-align: center; padding: 150px; } | |
| h1 { font-size: 50px; } |
| var mining_threads = 1 | |
| function checkWork() { | |
| if (eth.getBlock("pending").transactions.length > 0) { | |
| if (eth.mining) return; | |
| console.log("== Pending transactions! Mining..."); | |
| miner.start(mining_threads); | |
| } else { | |
| miner.stop(0); // This param means nothing | |
| console.log("== No transactions! Mining stopped."); |
| <?php | |
| function printbraces($n) { | |
| if($n>0) { | |
| start_printing("", $n, $n); | |
| } | |
| } | |
| function start_printing($s, $o, $c) { | |
| if($o > $c) | |
| return; | |
| if($o == 0 && $c == 0){ |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title>Site Maintenance</title> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <link href='https://fonts.googleapis.com/css?family=Lato:400,900' rel='stylesheet' type='text/css'> | |
| <style> | |
| h1 { font-size: 50px; color: #d33682; font-weight: 900; line-height: 3.5rem} |
| #!/bin/bash | |
| echo `date` >> /root/optipng.log | |
| find /var/www/html/mmdrupal/sites/default/files/styles/ -mtime -2 -iname '*.png' -print0 | \ | |
| xargs -0 optipng -o7 -log /root/optipng.log -preserve | |
| echo `date` >> /root/jpegoptim.log | |
| find /var/www/html/mmdrupal/sites/default/files/styles/ -mtime -2 -iname '*.jpg' -print0 | \ | |
| xargs -0 jpegoptim --max=90 --preserve --totals >> /root/jpegoptim.log |
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| DBUSER=user | |
| DBPASSWORD=pwd | |
| DBSNAME=sourceDb | |
| DBNAME=destinationDb | |
| DBSERVER=localhost | |
| fCreateTable="" | |
| fInsertData="" |