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
Navigation | |
Ctrl-D "Move half-page down | |
Ctrl-U "Move half-page up | |
Ctrl-B "Page up | |
Ctrl-F "Page down | |
**Nerd Tree** | |
Ctrl-f "Page down |
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
before_filter: cors_filters | |
def cors_filters | |
headers['Access-Control-Allow-Origin'] = '*' | |
headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS' | |
headers['Access-Control-Request-Method'] = '*' | |
headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization' | |
end |
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 ruby | |
# encoding: utf-8 | |
require "bunny" | |
conn = Bunny.new vhost: '/boxes', user: 'boxes', pass: 'xxx', host: '127.0.0.1' | |
conn.start | |
ch = conn.create_channel | |
x = ch.topic("boxes", durable: true) |
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
# A collection of Rake tasks to facilitate importing data from yout models into Elasticsearch. | |
# This will import the index as an alias, update the alias and delete the old ones | |
# It will also allow the importation of indexes via arguments | |
# Add this e.g. into the `lib/tasks/elasticsearch.rake` file in your Rails application: | |
# | |
# require 'elasticsearch/rails/tasks/import' | |
# | |
# To import the records from your `Article` model, run: |
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
######### Production PolkaSpots ######## | |
HS_WANIF=`uci -P/var/state get network.wan.ifname` | |
HS_LANIF=`uci -P/var/state get network.lan.ifname` | |
HS_NETWORK=192.168.4.0 | |
HS_NETMASK=255.255.255.0 | |
HS_UAMLISTEN=192.168.4.1 | |
HS_UAMPORT=3990 | |
HS_UAMUIPORT=4990 | |
# HS_DYNIP= | |
# HS_DYNIP_MASK=255.255.255.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
#!/bin/sh | |
# | |
if [ "X$SSH_AUTH_SOCK" = "X" ]; then | |
eval `ssh-agent -s` | |
ssh-add $HOME/.ssh/id_rsa | |
fi | |
HOST= | |
REDIS_SLAVE_PORT=6000 |
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
#!/bin/ruby | |
require 'json' | |
require 'time' | |
require 'syslog' | |
class Snapshot | |
def initialize() | |
@format = '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
Here is a dummy gubbins.rb | |
#!/usr/bin/ruby | |
class Gubbins | |
def initialize | |
@api_url = "https://api.polkaspots.com" | |
end |
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
it("should call CT's api and enable alerts for a box", function() { | |
expect($scope.box.is_monitored).toBe(false) | |
spyOn(boxFactory, 'alerts').andCallThrough() | |
var cont = element.find('input').controller('ngModel'); | |
cont.$setViewValue(true); | |
deferred.resolve({slug: 123, is_monitored: true}); | |
$scope.$apply() | |
expect($scope.status.processing).toBe(true) | |
expect(boxFactory.alerts).toHaveBeenCalled(); | |
expect($scope.box.is_monitored).toBe(true) |
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
{ | |
"ap_mac": "00-18-0A-13-XX-XX", | |
"unique_id": "xxx", | |
"created_at": "20141010", | |
"meraki_secret": "xxx", | |
"location_id": 1294, | |
"latitude": 52.924263174858446, | |
"longitude": -1.4837226407115054, | |
"day": 5, | |
"version": 2, |