Skip to content

Instantly share code, notes, and snippets.

#include <lmic.h>
#include <hal/hal.h>
#include <SPI.h>
// LoRaWAN NwkSKey, network session key
// This is the default Semtech key, which is used by the prototype TTN
// network initially.
static const PROGMEM u1_t NWKSKEY[16] = { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C };
// LoRaWAN AppSKey, application session key
@joscha
joscha / DS1307.cpp
Last active May 14, 2016 06:38 — forked from technobly/sparkDS1307.cpp
RTC DS1307 LIBRARY FOR SPARK CORE
#include "application.h"
#include "DS1307.h"
const uint8_t daysInMonth[13] = {
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
};
// number of days since 2000/01/01, valid for 2001..2099
static uint16_t date2days(uint16_t y, uint8_t m, uint8_t d) {
if (y >= 2000)
@joscha
joscha / README.md
Created January 1, 2016 06:08
Automated bisect for node projects

Script to run an automated git bisect in a node project.

This script assumes a standard location of node_modules and a defined test script.

$ git bisect bad # mark current revision as bad
$ git bisect good origin/master # mark origin/master as good
$ git bisect run ./test.sh # run automated bisection
$ git bisect reset # reset the bisect
// file X depending on EventEmitter
var EventEmitter = __webpack_require__(16);
// EventEmitter module
/***/ },
/* 16 */
/***/ function(module, exports, __webpack_require__) { ...
module.exports = EventEmitter;
function prettifySpreadsheetJSON(data) {
var prefix = 'gsx$';
for (var i = 0; i < data.feed.entry.length; i++) {
for (var key in data.feed.entry[i]) {
if (data.feed.entry[i].hasOwnProperty(key) && key.substr(0,prefix.length) === prefix) {
data.feed.entry[i][key.substr(prefix.length)] = data.feed.entry[i][key].$t;
delete data.feed.entry[i][key];
}
}
}
@joscha
joscha / install_bcm2385.sh
Last active August 29, 2015 14:13 — forked from annem/gist:3183536
Install BCM2385 library
#!/bin/sh
set -o errexit
bcm2385_version=1.38
rm bcm2835-$bcm2385_version.tar.gz
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-$bcm2385_version.tar.gz
tar zxvf bcm2835-$bcm2385_version.tar.gz
cd bcm2835-$bcm2385_version
./configure
make
@joscha
joscha / typesquare.fontlist.json
Created December 10, 2014 14:01
Tyesquare font list
{
"リュウミン": {
"familyName": "リュウミン",
"fonts": [{
"fontNum": "1",
"japaneseName": "リュウミン L-KL",
"englishName": "Ryumin Light KL",
"fontfamily": "リュウミン",
"fontfamilyMainfont": "Ryumin Light KL",
"style": "明朝体"
@joscha
joscha / bower.json
Last active August 29, 2015 14:07 — forked from Xiphe/bower.json
{
"name": "jasmine-moar-matchers",
"authors": [
"Hannes Diercks"
],
"description": "Some additional Jasmine 2.0 Matchers.",
"main": ["toBeInstanceOf.js", "toBeTypeOf.js", "promises.js"],
"keywords": [
"jasmine",
"matcher"
@joscha
joscha / .travis.yml
Created May 27, 2014 18:14
Sample travis file for typesafe activator
language: java
env:
- ACTIVATOR_VERSION=1.1.3 \
ACTIVATOR_ZIP_FILE=typesafe-activator-${ACTIVATOR_VERSION}-minimal.zip \
ACTIVATOR_ZIP_URL=http://downloads.typesafe.com/typesafe-activator/${ACTIVATOR_VERSION}/${ACTIVATOR_ZIP_FILE} \
ACTIVATOR_BIN=${TRAVIS_BUILD_DIR}/activator-${ACTIVATOR_VERSION}-minimal/activator
install:
- wget ${ACTIVATOR_ZIP_URL}
- unzip -q ${ACTIVATOR_ZIP_FILE}
script:
// jQuery Deparam - v0.1.0 - 6/14/2011
// http://benalman.com/
// Copyright (c) 2011 Ben Alman; Licensed MIT, GPL
(function($) {
// Creating an internal undef value is safer than using undefined, in case it
// was ever overwritten.
var undef;
// A handy reference.
var decode = decodeURIComponent;