Skip to content

Instantly share code, notes, and snippets.

View janjongboom's full-sized avatar

Jan Jongboom janjongboom

View GitHub Profile
@janjongboom
janjongboom / a.css
Created July 3, 2014 06:23
Weird animations
div {
border-radius: 50%;
position: absolute;
width: 100px;
height: 100px;
background: linear-gradient(90deg, orange, blue)
}
div.move-out {
animation: 10s weird-move-out infinite;
@janjongboom
janjongboom / gist:88cb698cdd475d2591dd
Created February 3, 2015 09:04
Remove pin on FFOS
var pin = '0000';
var icc = navigator.mozIccManager.getIccById(navigator.mozIccManager.iccIds[0]);
if (icc.cardState === 'pinRequired') {
var req = icc.unlockCardLock({ lockType: 'pin', pin: pin });
req.onsuccess = function() {
console.log('pin unlocked');
var r2 = icc.setCardLock({ lockType: 'pin', pin: pin, enabled: false });
r2.onsuccess = function() {
@janjongboom
janjongboom / gist:8faddcbfc361acab4ec4
Created February 23, 2015 12:02
Flash Jan's experimental build for rpi
  1. Follow instructions to install the prebuilt version for rpi from here: https://wiki.mozilla.org/Hacking_b2g_on_Raspberry_Pi
  2. Boot rpi and connect to wired network. Find the IP it's registered via nmap --open -p 5555 192.168.2.*
  3. Connect over adb: (f.e.) adb connect 192.168.2.100
  4. Checkout jan-os/gecko-dev, rpi branch; and use it as your GECKO_PATH
  5. Think this only works on Ubuntu by the way, but:
  6. In B2G, ./config.sh rpi && ./build.sh gecko && ./flash.sh gecko
  7. Checkout jan-os/janos, gpio branch
  8. Run make reset-phone
  9. adb logcat to see if flashing succeeded
diff --git a/dom/apps/AppsUtils.jsm b/dom/apps/AppsUtils.jsm
index b44c11e..edc5caa 100644
--- a/dom/apps/AppsUtils.jsm
+++ b/dom/apps/AppsUtils.jsm
@@ -33,7 +33,7 @@ this.EXPORTED_SYMBOLS =
["AppsUtils", "ManifestHelper", "isAbsoluteURI", "mozIApplication"];
function debug(s) {
- //dump("-*- AppsUtils.jsm: " + s + "\n");
+ dump("-*- AppsUtils.jsm: " + s + "\n");
@janjongboom
janjongboom / ibeacon.js
Created May 18, 2015 12:42
iBeacon scanning Firefox OS
navigator.mozBluetooth.defaultAdapter.startLeScan([]).then(handle => {
console.log('Start scanning', handle);
handle.ondevicefound = e=> {
var record = parseScanRecord(e.scanRecord);
if (record) {
console.log('Found an iBeacon', record.uuid, record.major, record.minor, e.rssi);
}
}
setTimeout(() => {
@janjongboom
janjongboom / loraCS.js
Created September 8, 2015 07:12
LoRa Customer Server in node
var net = require('net');
var server = net.createServer(function(socket) {
console.log('Listening yo');
socket.on('data', function(data) {
if (data.length === 1 && data[0] === 0x00) {
return; // some sort of ping?
}
// so all messages end with 0x00 so skip that
var obj = data.toString('utf8', 0, data.length - 1);
@janjongboom
janjongboom / emscripten_mmap.h
Last active September 23, 2015 04:33
emscripten_mmap.h
#ifndef EMSCRIPTEN_MMAP_H_
#define EMSCRIPTEN_MMAP_H_
#ifndef EMSCRIPTEN
#define define_mmap_write(T, name) \
void mmap_write_##name(void* map, size_t index, T value) { \
((T*)map)[index] = value; \
}
#define define_mmap_read(T, name) \
@janjongboom
janjongboom / hallo.js
Created October 3, 2011 12:37
tes123
alert('hoi');
alert(1+1);
@janjongboom
janjongboom / c9-tralalaala
Created October 4, 2011 09:43
Cloud9 test
// hello this is a test
/// <reference path="jquery-1.4.1.js" />
/*
* jQuery plugin: zoekbox - v1.0.0
* (c) 2010-2011 funda real estate <jan@funda.nl> - http://www.funda.nl
*
* This is the core library for EVERYTHING that uses the zoekbox;
* either geo, nieuwbouw-projects, or even the names of all funda employees
* therefore NEVER EVER add anything that is implementation-specific to this code.
*
@janjongboom
janjongboom / abc
Created October 5, 2011 09:56
dit is een test
Hoi not authenticated