This file contains hidden or 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 getJSON = function(url, successHandler, errorHandler) { | |
var xhr = typeof XMLHttpRequest != 'undefined' | |
? new XMLHttpRequest() | |
: new ActiveXObject('Microsoft.XMLHTTP'); | |
xhr.open('get', url, true); | |
xhr.onreadystatechange = function() { | |
var status; | |
var data; | |
// https://xhr.spec.whatwg.org/#dom-xmlhttprequest-readystate | |
if (xhr.readyState == 4) { // `DONE` |
This file contains hidden or 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
<script> | |
var getJSON = function(url, successHandler, errorHandler) { | |
var xhr = typeof XMLHttpRequest != 'undefined' ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); | |
xhr.open('get', url, true); | |
xhr.onreadystatechange = function() { | |
var status; | |
var data; | |
// https://xhr.spec.whatwg.org/#dom-xmlhttprequest-readystate | |
if (xhr.readyState == 4) { // `DONE` | |
status = xhr.status; |
This file contains hidden or 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
from socket import * | |
import webbrowser | |
Host = "192.168.1.118" | |
Port = 2401 | |
BufSize = 1024 | |
Addr = (Host,Port) | |
def makeServer(): |
This file contains hidden or 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 net = require('net'); | |
var open = require('open'); | |
var HOST = '127.0.0.1'; | |
var PORT = 2401; | |
net.createServer(function(sock) { | |
// We have a connection - a socket object is assigned to the connection automatically | |
console.log('CONNECTED: ' + sock.remoteAddress +':'+ sock.remotePort); |
This file contains hidden or 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 net = require('net'); | |
var open = require('open'); | |
var HOST = '127.0.0.1'; | |
var PORT = 2401; | |
net.createServer(function(sock) { | |
// We have a connection - a socket object is assigned to the connection automatically | |
console.log('CONNECTED: ' + sock.remoteAddress +':'+ sock.remotePort); |
This file contains hidden or 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 app = require('app') | |
var BrowserWindow = require('browser-window') | |
var net = require('net'); | |
var HOST = '127.0.0.1'; | |
var PORT = 2401; | |
app.on('ready', function(){ | |
var mainWindow = new BrowserWindow({fullscreen: true, kiosk : true}) |
This file contains hidden or 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 beacons_id : [Int] = [55103,51097,23873] | |
func locationManager(manager: CLLocationManager! , didRangeBeacons beacons: [AnyObject]!, inRegion region: CLBeaconRegion!) { | |
let knownBeacons = beacons.filter{ $0.proximity != CLProximity.Immediate} | |
if (knownBeacons.count > 0) { | |
let closestBeacon = knownBeacons[0] as! CLBeacon | |
if (closestBeacon.minor.integerValue == beacons_id[0]) { | |
MMT.enabled = true | |
startBlinking() | |
var timer = NSTimer.scheduledTimerWithTimeInterval(5, target: self, selector: Selector("stopBlinking"), userInfo: nil, repeats: true) |
This file contains hidden or 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
import UIKit | |
import CoreLocation | |
class ViewController: UIViewController, CLLocationManagerDelegate { | |
@IBOutlet var distanceReading: UILabel! | |
let locationManager = CLLocationManager() | |
override func viewDidLoad() { |
This file contains hidden or 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
import UIKit | |
import CoreLocation | |
class ViewController: UIViewController, CLLocationManagerDelegate { | |
// core location manager instance | |
let locationManager = CLLocationManager() | |
// define the core location region, defines whic beacons our regions should care about |
This file contains hidden or 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 app = require('app') | |
var BrowserWindow = require('browser-window') | |
var net = require('net'); | |
var HOST = '192.168.1.36'; | |
var PORT = 2401; | |
app.on('ready', function(){ | |
var mainWindow = new BrowserWindow({fullscreen: true, "node-integration": false}) |