Skip to content

Instantly share code, notes, and snippets.

Stuart Colville muffinresearch

Block or report user

Report or block muffinresearch

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View test-addon-manager.js
// INSTALL THE ADD-ON
let data = {
noscript: {
id: '{73a6fe31-595d-460b-a920-fcc0f8843232}',
installURL: 'https://addons.mozilla.org/firefox/downloads/latest/722/addon-722-latest.xpi?src=dp-btn-primary'
},
mutetabs: {
id: 'mute-all-inactive-tabs@evilpie.tomschuster.name',
installURL: 'https://addons.mozilla.org/firefox/downloads/file/394320/mute_all_inactive_tabs-0.1.1.xpi?src=ss',
View gist:14a07ab7e6471af4fb78
diff --git a/static/js/common/fxa-login.js b/static/js/common/fxa-login.js
index 2f6428b..9ff32c4 100644
--- a/static/js/common/fxa-login.js
+++ b/static/js/common/fxa-login.js
@@ -32,13 +32,20 @@ function enableFxALogin() {
});
}
+ // utf-8 handling from https://mzl.la/1LwX2Zx
+ function utf8Tob64(str) {
View gist:47084ed1de41250d4e0f
From ad155917679b816451cbfeeec69865ab7506119d Mon Sep 17 00:00:00 2001
From: Daniel Sabelnikov <dsabelnikov@gmail.com>
Date: Sun, 3 May 2015 22:59:14 +0300
Subject: [PATCH] Add "libtermkey" key bindings preset
---
plists/PresetKeyMappings.plist | 381 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 381 insertions(+)
diff --git a/plists/PresetKeyMappings.plist b/plists/PresetKeyMappings.plist
@muffinresearch
muffinresearch / svg2png.js
Created Jul 16, 2015
svg2png config example
View svg2png.js
module.exports = {
all: {
// specify files in array format with multiple src-dest mapping
files: [
// rasterize all SVG files in "img" and its subdirectories to "img/png"
{ cwd: 'public/svg/', src: ['**/*.svg'], dest: 'public/img/' }
]
}
};
@muffinresearch
muffinresearch / shell-output-nginx-conf-update.sh
Last active Aug 29, 2015
Quick nginx conf update test under docker.
View shell-output-nginx-conf-update.sh
bash-4.1# vi /etc/nginx/conf.d/payments-env.conf
bash-4.1# ps aux | grep [n]ginx
root 1 0.0 0.2 45228 5608 ? Ss 11:31 0:00 nginx: master process nginx -c /etc/nginx/nginx.conf -g daemon off;
nginx 5 0.0 0.1 45736 3308 ? S 11:31 0:00 nginx: worker process
bash-4.1# kill -HUP 1
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
function MyConstructor(foo, bar){
@muffinresearch
muffinresearch / arguments-flexible-constructor.js
Last active Aug 29, 2015
Using arguments in flexible constructor
View arguments-flexible-constructor.js
function MyConstructor(foo, bar){
if (!(this instanceof MyConstructor)){
var obj = Object.create(MyConstructor.prototype);
return MyConstructor.apply(obj, arguments);
}
this.foo = foo;
this.bar = bar;
return this;
}
@muffinresearch
muffinresearch / example-no-new.js
Last active Aug 29, 2015
new keyword not used
View example-no-new.js
function MyConstructor(){
console.log(this.toString());
}
var instance1 = MyConstructor();
var instance2 = new MyConstructor();
@muffinresearch
muffinresearch / flexible-constructor.js
Last active Feb 4, 2018
Constructor that works without new keyword.
View flexible-constructor.js
function MyConstructor(foo){
if (!(this instanceof MyConstructor)){
return new MyConstructor(foo);
}
this.foo = foo;
return this;
}
var instance1 = MyConstructor('foo1');
var instance2 = new MyConstructor('foo2');
@muffinresearch
muffinresearch / gist:324030c72f8c3a5ed8d4
Last active Jun 8, 2016
Switch to nfs instead of vboxfs for FFOS Marketplace boot2docker env (on OSX)
View gist:324030c72f8c3a5ed8d4
# Backup /etc/exports
sudo cp /etc/exports{,.bck}
# Append a link onto /etc/exports to configure nfs
echo '"'$(mkt root)'"' -alldirs -mapall=$(id -u $USER):$(id -g $USER) $(boot2docker ip) | sudo tee -a /etc/exports
sudo /sbin/nfsd restart
# Next let's unmount the old mount, start nfs and mount the nfs share.
boot2docker ssh "sudo umount $(mkt root)"
boot2docker ssh "sudo /usr/local/etc/init.d/nfs-client start"
boot2docker ssh "sudo mount $(boot2docker config | grep HostIP | cut -d'"' -f2):$(mkt root) $(mkt root) -o rw,async,noatime,rsize=32768,wsize=32768,proto=tcp"
You can’t perform that action at this time.