This file contains 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 | |
/* | |
Plugin Name: rewrite test | |
Description: rewrite test | |
Author: Nick | |
Version: 1.0 | |
*/ | |
register_activation_hook(__FILE__, 'activate'); |
This file contains 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
/* | |
here is the json being passed into the function when the user clicks on the routes dropdown box | |
{"locations":[{"latitude":"47.610000","longitude":"-122.330000","speed":"0","direction":"0","distance":"0.0","location_method":"na","gps_time":"Jan 3 2007 01:37PM","user_name":"wordpressUser2","session_id":"8BA21D90-3F90-407F-BAAE-800B04B1F5EA","accuracy":"137","extra_info":"na"}]} | |
{"locations":[{"latitude":"47.610000","longitude":"-122.330000","speed":"0","direction":"0","distance":"0.0","location_method":"na","gps_time":"Jan 3 2007 01:37PM","user_name":"wordpressUser","session_id":"8BA21D90-3F90-407F-BAAE-800B04B1F5EC","accuracy":"137","extra_info":"na"}]} | |
*/ | |
function loadGPSLocations(json) { |
This file contains 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 | |
defined('ABSPATH') or exit; | |
/* | |
Plugin Name: Gps Tracker Endpoint | |
Plugin URI: https://www.websmithing.com/gps-tracker | |
Description: Create an endpoint for Gps Tracker. | |
Version: 1.0.0 | |
Author: Nick Fox | |
Author URI: https://www.websmithing.com/hire-me | |
License: GPL2 |
This file contains 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
$gps_time = urldecode($wp_query->query_vars['gpstime']); | |
// gpstime of '0000-00-00 00:00:00' is how we determine if its a nonce request | |
if ($gps_time == '0000-00-00 00:00:00') { | |
$session_id = $wp_query->query_vars['sessionid']; | |
$session_id_pattern = '[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}'; | |
if (preg_match($session_id_pattern, $session_id)) { | |
$wpnonce = wp_create_nonce($session_id); | |
} else { |
This file contains 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
night:/home/nick/node/sunsetvote# sysctl -a | grep bindv6only | |
error: "Invalid argument" reading key "fs.binfmt_misc.register" | |
error: permission denied on key 'net.ipv4.route.flush' | |
error: permission denied on key 'net.ipv6.route.flush' | |
net.ipv6.bindv6only = 0 |
This file contains 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
night:/home/nick/node/sunsetvote# netstat -anp 2> /dev/null | grep :3000 | |
tcp6 0 0 :::3000 :::* LISTEN 20918/node |
This file contains 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
curl 7.22.0 (i686-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3 | |
Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtmp rtsp smtp smtps telnet tftp | |
Features: GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP | |
root@night:/home/nick/node/sunsetvote# curl -v localhost:3000/helloworld | |
* About to connect() to localhost port 3000 (#0) | |
* Trying 127.0.0.1... connected | |
> GET /helloworld HTTP/1.1 | |
> User-Agent: curl/7.22.0 (i686-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3 | |
> Host: localhost:3000 | |
> Accept: */* |
This file contains 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
#!/usr/bin/env node | |
var debug = require('debug')('sunsetvote'); | |
var app = require('../app'); | |
app.set('port', process.env.PORT || 3000); | |
var server = app.listen(app.get('port'), function() { | |
debug('Express server listening on port ' + server.address().port); | |
}); |
This file contains 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
{ | |
"name": "sunsetvote", | |
"version": "0.0.1", | |
"private": true, | |
"scripts": { | |
"start": "node ./bin/www" | |
}, | |
"dependencies": { | |
"express": "~4.2.0", | |
"static-favicon": "~1.0.0", |
This file contains 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
var express = require('express'); | |
var path = require('path'); | |
var favicon = require('static-favicon'); | |
var logger = require('morgan'); | |
var cookieParser = require('cookie-parser'); | |
var bodyParser = require('body-parser'); | |
var routes = require('./routes/index'); | |
var users = require('./routes/users'); |
NewerOlder