I hereby claim:
- I am evansmwendwa on github.
- I am evansmwendwa (https://keybase.io/evansmwendwa) on keybase.
- I have a public key ASAaLpKDfAj1xaaNCPtTFX-to8Of8GHExNsVjjTLdnzMKwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| function parseISOString(s) { | |
| var b = s.split(/\D+/); | |
| return new Date(Date.UTC(b[0], --b[1], b[2], b[3], b[4], b[5], b[6])); | |
| } | |
| function pullJSON() { | |
| var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
| var sheets = ss.getSheets(); | |
| var sheet = ss.getActiveSheet(); |
| <?php | |
| /* | |
| Plugin Name: php Malicious Code Scanner | |
| Plugin URI: http://www.mikestowe.com/phpmalcode | |
| Description: The php Malicious Code Scanner checks all files for one of the most common malicious code attacks, the eval( base64_decode() ) attack... | |
| Version: 1.3 alpha | |
| Author: Michael Stowe | |
| Author URI: http://www.mikestowe.com | |
| Credits: Based on the idea of Er. Rochak Chauhan (http://www.rochakchauhan.com/), rewritten for use with a cron job | |
| License: GPL-2 |
Warning! Intermediate experience in setting up Nginx and Python in ubuntu is required to follow this setup
This setup uses Python version 2.7.x and Ubuntu 16 setup with a non root sudo account.
This Tutorial follows the article provided by digital ocean https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04 and the setup is done in a digital ocean droplet provisioned by Laravel forge. Forge's
sitesfeature andSSLfeature is used instead of manual nginx server blocks.
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" /> | |
| <title>Welcome to FarAndOut Studio</title> | |
| <style media="screen"> | |
| html { | |
| -webkit-box-sizing: border-box; | |
| -moz-box-sizing: border-box; |
| <?php | |
| function http_get_file($remote_url, $local_file) { | |
| $fp = fopen($local_file, 'w'); | |
| $cp = curl_init($remote_url); | |
| curl_setopt($cp, CURLOPT_FILE, $fp); | |
| $buffer = curl_exec($cp); |
| # FORGE CONFIG (DOT NOT REMOVE!) | |
| include forge-conf/afriscout.ihub.co.ke/before/*; | |
| server { | |
| listen 80; | |
| listen [::]:80; | |
| server_name afriscout.ihub.co.ke; | |
| return 301 https://$host$request_uri; | |
| } |
| --- | |
| METHOD 1 | |
| This should roughly sort the items on distance in MySQL, and should work in SQLite. | |
| If you need to sort them preciser, you could try using the Pythagorean theorem (a^2 + b^2 = c^2) to get the exact distance. | |
| --- | |
| SELECT * | |
| FROM table | |
| ORDER BY ((lat-$user_lat)*(lat-$user_lat)) + ((lng - $user_lng)*(lng - $user_lng)) ASC |