Skip to content

Instantly share code, notes, and snippets.

View nickdesaulniers's full-sized avatar

Nick Desaulniers (paternity leave) nickdesaulniers

View GitHub Profile
anonymous
anonymous / tmux.conf
Created September 9, 2014 18:35
vim friendly tmux configuration
#Prefix is Ctrl-a
set -g prefix C-a
bind C-a send-prefix
unbind C-b
set -sg escape-time 1
set -g base-index 1
setw -g pane-base-index 1
#Mouse works as expected
@rjz
rjz / notes.md
Last active August 29, 2015 13:57
Notes from Nick Desaulniers on Convergence of the Browser and the OS

Convergence of the Browser and OS

Nick Desaulniers (Open Source @ Mozilla)

  • [What does "Open Source" mean to me?][1]

What would a desktop environment look like if it were implemented entirely in a browser?

@gre
gre / README.md
Last active November 12, 2021 15:20
Boilerplate of a JS1K submission + JSCrush & uglify tools

JS1K Boilerplate

Build tools

Install tools

npm install
@digitarald
digitarald / detectByConnection.js
Created December 6, 2013 18:21
Using mozMobileConnections with MNC and MCC to enable app features for specific country/carrier combinations
var mccs = [];
try {
// navigator.mozMobileConnections is the new API.
// navigator.mozMobileConnection is the legacy API.
var conn;
if ((conn = navigator.mozMobileConnection)) {
console.log('navigator.mozMobileConnection available');
// `MCC`: Mobile Country Code
@hgomez
hgomez / mint141516.md
Last active October 23, 2018 14:08
Mint 14 -> Mint 15 -> Mint 16

Mint upgrade procedures

Some investigation and tests on how to upgrade Mint machine.

Tests performed on Mint Cinnamon 14/15/16, on physical machine 14->15 and VirtualBox VMs for 14->15->16 and 14->16.

As usual you could break your machine, so please do backups before and cross fingers.

Mint 14 -> Mint 15

@vuldin
vuldin / default.prop
Last active December 22, 2015 18:29
Install latest dev build of FxOS on ZTE Open
ro.secure=0
ro.allow.mock.location=1
ro.debuggable=1
persist.usb.serialno=full_inari
persist.sys.usb.config=adb
@drhelius
drhelius / Game Boy Boot ROM Disassembly
Last active November 20, 2023 18:34
Game Boy Boot ROM Disassembly
LD SP,$fffe ; $0000 Setup Stack
XOR A ; $0003 Zero the memory from $8000-$9FFF (VRAM)
LD HL,$9fff ; $0004
Addr_0007:
LD (HL-),A ; $0007
BIT 7,H ; $0008
JR NZ, Addr_0007 ; $000a
LD HL,$ff26 ; $000c Setup Audio
@louisstow
louisstow / external.js
Last active December 19, 2015 04:29
Force external links to open in a new browser window on Firefox OS
if (navigator.mozApps && window.locationbar.visible === false) {
var externalLinks = document.querySelectorAll("a[href^='http']:not([href*='"+location.host+"'])");
for (var i = 0; i < externalLinks.length; ++i) {
externalLinks[i].setAttribute("target", "_blank");
}
}
@digitarald
digitarald / 1-moz-mobile-connection-snippet.js
Last active December 18, 2015 03:19
Detect carrier and region from `mozMobileConnection`'s `MNC` and `MCC`
// Original https://github.com/mozilla/fireplace/blob/c50b5ca51643f13ae2e8b3a003d3aa0432358bf7/hearth/media/js/user.js#L41
// Retrieve MCC and MNC from mozMobileConnection (requires "privileged" app type and "mobileconnection" permission)
// and translates them to carrier and region via mobilenetwork.js
try {
// When Fireplace is served as a privileged packaged app (and not
// served via Yulelog) our JS will have direct access to this API.
var conn = navigator.mozMobileConnection;
if (conn) {
@digitarald
digitarald / language-detect.js
Last active December 17, 2015 04:19
Detect language changes when switching to app. I personally recommend setting current language only on app launch. Reacting to changes later benefits only a small set of users, focus on the 99%!
// Example code, use with caution!
// Events and .hidden property requires no prefix since 18
// Set current language on launch
document.documentElement.lang = navigator.language;
function visibilityChange() {
// user went off page, ignore
if (document.hidden) return;