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
module['exports'] = function dashboard (hook) { | |
function get(key, callback) { | |
var datastore = hook.datastore; | |
datastore.get(key, function (err, counter) { | |
callback(counter || 0); | |
}); | |
} | |
get('counter', function (counter) { |
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
<html> | |
<head><title>Counter</title> | |
<style> | |
body { | |
max-width: 500px; | |
margin: 50px auto; | |
text-align: center; | |
font-family: 'Helvetica','Arial',sans-serif; | |
} | |
h1 { |
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
void loop() { | |
static bool pressedOld = false; | |
bool pressed = HAL_Core_Mode_Button_Pressed(50); | |
if (pressed && !pressedOld) { | |
Particle.publish("press"); | |
} | |
pressedOld = pressed; | |
} |
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
// A Slack slash command to convert between timezones. | |
// Copyright 2015 Julien Vanier | |
// Released under the MIT license | |
// Adapted from https://github.com/forresto/slack-slash-time | |
var got = require('got'); | |
var chrono = require('chrono-node'); | |
var moment = require('moment'); | |
// Entry point for hook.io |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
monkbroc@slim:~/Programming/Photon/modules$ make clean all program-dfu PARTICLE_DEVELOP=1 PLATFORM=photon USE_SWD_JTAG=y | |
clean all program-dfu | |
make -C /home/monkbroc/Programming/Photon/modules/photon/system-part1/ clean all program-dfu USE_SWD_JTAG=y PLATFORM=photon PARTICLE_DEVELOP=1 | |
make[1]: Entering directory '/home/monkbroc/Programming/Photon/modules/photon/system-part1' | |
make -C ../../../communication clean | |
make[2]: Entering directory '/home/monkbroc/Programming/Photon/communication' | |
rm -f ../build/target/communication/platform-6-m-prod-6/lib/tropicssl/library/aes.o ../build/target/communication/platform-6-m-prod-6/lib/tropicssl/library/bignum.o ../build/target/communication/platform-6-m-prod-6/lib/tropicssl/library/padlock.o ../build/target/communication/platform-6-m-prod-6/lib/tropicssl/library/rsa.o ../build/target/communication/platform-6-m-prod-6/lib/tropicssl/library/sha1.o ../build/target/communication/platform-6-m-prod-6/src/coap.o ../build/target/communication/platform-6-m-prod-6/src/handshake. |
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
#!/usr/bin/env ruby | |
# Analyze heap dumps for memory leaks | |
# | |
# Gather the memory dumps with | |
# bundle exec rbtrace — timeout 30 -e ‘load “#{Rails.root}/scripts/heap_dump.rb”’ -p $RAILS_PID | |
require 'set' | |
require 'json' | |
if ARGV.length != 3 |
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
-- | |
-- PostgreSQL database dump | |
-- | |
SET statement_timeout = 0; | |
SET lock_timeout = 0; | |
SET client_encoding = 'UTF8'; | |
SET standard_conforming_strings = on; | |
SET check_function_bodies = false; | |
SET client_min_messages = warning; |