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
// On the photon, analog reading values are: 0 = 0.0V and 4095 = 3.3V. | |
// Do NOT put more than 3.3V into an analog input pin on a photon or you'll damage the photon. | |
// Since the pressure tranducer can output more than 3.3V (up to 4.5V), we'll need to create a voltage divider to protect the photon: | |
// https://learn.sparkfun.com/tutorials/voltage-dividers/all | |
const float PHOTON_VOLTAGE_COEFFICIENT = 3.3 / 4096; | |
const float SENSOR_MIN_V = 0.5; | |
const float SENSOR_MAX_V = 4.5; | |
const float SENSOR_MIN_PSI = 0.0; |
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
<?php | |
namespace Tests; | |
use Facebook\WebDriver\Remote\DesiredCapabilities; | |
use Facebook\WebDriver\Remote\RemoteWebDriver; | |
use Laravel\Dusk\TestCase as BaseTestCase; | |
abstract class DuskTestCase extends BaseTestCase { | |
use CreatesApplication; |
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 php | |
<?php | |
$input = isset($argv[1]) ? $argv[1] : null; | |
$output = isset($argv[2]) ? $argv[2] : null; | |
if (!$input || !file_exists($input)) { | |
die("No valid input file specified.\n"); | |
} | |
if (!$output) { |
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
// echo all the raw GPS data to the USB serial port? | |
#define GPSECHO false | |
#define gpsSerial Serial1 | |
#define PMTK_SET_NMEA_OUTPUT_OFF "$PMTK314,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28" // turn off output | |
#define PMTK_SET_NMEA_OUTPUT_RMCGGA "$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28" // turn on GPRMC and GGA | |
#define PMTK_SET_NMEA_UPDATE_1HZ "$PMTK220,1000*1F" // Set the update rate 1 Hz update rate | |
#define PGCMD_NOANTENNA "$PGCMD,33,0*6C" // Mute antenna status events |
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
<?php | |
namespace foo; | |
class Foobar { | |
public function foo (\boolean $barf) { // Catchable fatal error: Argument 1 passed to foo\Foobar::foo() must be an instance of boolean, boolean given | |
echo $barf ? "yep" : "nope"; | |
} | |
public function bar (boolean $barf) { // Catchable fatal error: Argument 1 passed to foo\Foobar::bar() must be an instance of foo\boolean, boolean given | |
echo $barf ? "yep" : "nope"; |
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
// To run, first install the twit and eventsource packages: | |
// npm install twit eventsource | |
// then: | |
// node app.js | |
// From the spark core, call: | |
// Spark.publish("tweet", "Hello Twitter. (Test post, please ignore)", 60, PRIVATE); | |
var EventSource = require('eventsource'); |
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 python | |
# on Ubuntu: | |
# sudo apt-get install python-scapy | |
# You'll need to run this script as root to send these ARP packets | |
from scapy.all import * | |
victim = '192.168.1.131' # ip address of CC3000 |
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
// Twitter firehose client. | |
// Written by TJ Hunter | |
// https://dev.twitter.com/docs/api/1/post/statuses/filter | |
var https = require('https'); | |
// Command line args | |
var username = process.argv[2]; | |
var password = process.argv[3]; | |
var keyword = process.argv[4] || "zombie"; |
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
<?php | |
$scope = ""; | |
// From: https://developers.facebook.com/docs/authentication/permissions/ | |
/********************* | |
* User and Friends Permissions | |
* You can ask for the following permissions for users and friends in the scope parameter as part of the authentication process. | |
* If you are using the Enhanced Auth Dialog, the following permissions are not user-revokable within the authentication flow. | |
* If you request these permissions from the user as part of first-time authentication, the user must grant these permissions |
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
<?php | |
/* | |
loggly-access.php | |
Sends apache access log lines to loggly via HTTP input | |
Author: TJ Hunter ([email protected]) | |
Add the following line to your apache config: | |
CustomLog "|php /path/to/loggly-access.php VirtualHostServerNameHere logglyInputHash" combined | |
*/ |