Skip to content

Instantly share code, notes, and snippets.

View meandavejustice's full-sized avatar

Dave Justice meandavejustice

View GitHub Profile
@jrod-disco
jrod-disco / soundSprite.js
Last active October 1, 2024 19:51
An attempt at handling sound sprites in Expo
import { Audio } from 'expo-av';
import { AssetLibrary } from '../AssetLibrary';
/**
* Factory function to create sound sprites.
*
* Takes configuration object on init.
*
* Once configured a key can be played like so
* spriteInstance.play('validKeyDefinedInConfig')'
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@magegu
magegu / multipart.js
Last active July 11, 2023 20:12
mutipart upload for aws s3 with nodejs based on the async lib including retries for part uploads
/*
by Martin Güther @magegu
just call it:
uploadFile(absoluteFilePath, callback);
*/
var path = require('path');
var async = require('async');
@jaredhirsch
jaredhirsch / ugh.js
Last active January 15, 2016 19:34
loading code in one addon from another addon
// skipping the imports of Cu and AddonManager here:
// get an addon pointer
var addon;
AddonManager.getAddonByID('@idea-town-addon', function(x) { addon = x; });
// get the local machine's file path of the addon
var addonURI = addon.getResourceURI().asciiSpec;
// ugh, wrap the `file:///` URI in a `jar:///` URI,
// to get access to the metrics.jsm file inside the zipped idea town xpi.
// figured this out after a long search in dxr:
@bishboria
bishboria / springer-free-maths-books.md
Last active October 3, 2024 09:17
Springer made a bunch of books available for free, these were the direct links
@dlmanning
dlmanning / toolbar.js
Last active December 16, 2015 01:31
How I make react components without react
import Icon from 'react-fa'
import hoverable from 'lib/hocs/hoverable'
import instyled, { flatKeyed } from 'instyled'
import cascade from 'cascade'
export const EditButton = hoverable(
instyled(
flatKeyed(
cascade({
position: 'absolute',
@Noitidart
Noitidart / _ff-addon-snippet-playSound.js
Created August 20, 2015 03:22
_ff-addon-snippet-playSound - Trying to use Audio API to play sound.
function audioContextCheck() {
if (typeof Services.appShell.hiddenDOMWindow.AudioContext !== 'undefined') {
return new Services.appShell.hiddenDOMWindow.AudioContext();
} else if (typeof Services.appShell.hiddenDOMWindow.mozAudioContext !== 'undefined') {
return new Services.appShell.hiddenDOMWindow.mozAudioContext();
} else {
throw new Error('AudioContext not supported');
}
}
@stfnhh
stfnhh / share.sh
Last active November 1, 2022 02:20
Command line interface for file.io
#!/bin/bash
WEEKS=0
ENCRYPTION=false
FILE=$1
usage() {
cat <<EOF
Usage: $0 FILE [options]
@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing