Skip to content

Instantly share code, notes, and snippets.

View justindarc's full-sized avatar

Justin D'Arcangelo justindarc

View GitHub Profile
@justindarc
justindarc / Fetch.sublime-settings
Created October 6, 2012 07:01
Sublime Text 2 - Fetch Settings
{
"files":
{
// jQuery
"jquery.js" : "http://code.jquery.com/jquery.js",
"jquery.min.js" : "http://code.jquery.com/jquery.min.js",
// jQuery Plugins
"jquery.cookie.js" : "https://raw.github.com/carhartl/jquery-cookie/master/jquery.cookie.js",
@justindarc
justindarc / angular-snap.js
Last active December 17, 2015 14:19
AngularJS Directive for Snap.js
angular.module('angular-snap', [])
.directive('snap', function() {
var parseBoolean = function(attrValue, defaultValue) {
var strValue = '' + attrValue;
if (strValue === 'true' ||
strValue === 'yes' ||
strValue === '1') return true;
if (strValue === 'false' ||
@justindarc
justindarc / index.html
Created January 26, 2014 06:43
Snap.js Lists
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if IEMobile 7 ]> <html class="no-js iem7"> <![endif]-->
<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Snap List</title>
@justindarc
justindarc / layertree.js
Last active January 27, 2021 00:51
Firefox OS Layer Tree Utility
#!/usr/bin/env node
/**
* Firefox OS Layer Tree Utility
*
* Captures layer tree dumps from `adb logcat` and
* outputs them to the console without log noise.
*
* Usage:
*
@justindarc
justindarc / enable_wifi_direct.sh
Last active September 4, 2018 20:08
enable_wifi_direct.sh
#!/bin/sh
adb shell "mount -o rw,remount /system"
adb shell "stop b2g"
adb shell "echo \"ro.moz.wifi.p2p_supported=1\" >> /system/build.prop"
adb shell "mount -o ro,remount /system"
adb reboot
@justindarc
justindarc / enable_developer_mode.sh
Last active August 29, 2015 14:19
enable_developer_mode.sh
#!/bin/sh
adb shell "stop b2g"
adb shell "cd /data/b2g/mozilla/*.default/;echo 'user_pref(\"dom.apps.developer_mode\", true);' >> prefs.js;"
adb shell "cd /data/b2g/mozilla/*.default/;echo 'user_pref(\"network.disable.ipc.security\", true);' >> prefs.js;"
adb shell "start b2g"
@justindarc
justindarc / .userconfig
Created April 20, 2015 19:02
B2G .userconfig
export B2G_DIR=${B2G_DIR:-$(cd $(dirname $0); pwd)}
# Uncomment for debugging
# export B2G_DEBUG=1
# b2g-inbound
# export GECKO_PATH=${B2G_DIR}/b2g-inbound
# export GECKO_OBJDIR=${B2G_DIR}/objdir-b2g-inbound
# mozilla-central
@justindarc
justindarc / index.js
Created February 23, 2016 20:02
node-mdns-http-test
var http = require('http');
var mdns = require('mdns');
const HTTP_PORT = 8000;
var server = http.createServer(function(request, response) {
response.end('Hello world!');
});
server.listen(HTTP_PORT);
@justindarc
justindarc / esp8266-ap-flyweb-temperature-server.ino
Created March 17, 2016 19:39
esp8266-ap-flyweb-temperature-server
// Install ESP8266 Board v2.1.0 by adding this
// to the "Additional Board Manager URLs" in
// "Preferences..." and then select it for
// installation via "Boards Manager..." under
// the "Tools" -> "Board: XXX" menu.
// http://arduino.esp8266.com/stable/package_esp8266com_index.json
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
@justindarc
justindarc / hello-flyweb.js
Created March 29, 2016 19:45
hello-flyweb.js
navigator.publishServer('HelloFlyWeb').then((srv) => {
(window.srv = srv).onfetch = (evt) => {
evt.respondWith(new Response('<h1>Hello FlyWeb!!!</h1>', {
headers: { 'Content-Type': 'text/html' }
}));
};
});