Skip to content

Instantly share code, notes, and snippets.

(function() {
"use strict";
global.AudioContext = global.AudioContext || global.webkitAudioContext;
global.OfflineAudioContext = global.OfflineAudioContext || global.webkitOfflineAudioContext;
if (typeof global.AudioContext !== "undefined") {
if (typeof global.AudioContext.prototype.createGain !== "function") {
global.AudioContext.prototype.createGain = global.AudioContext.prototype.createGainNode;
}
@cyrilis
cyrilis / colors.sh
Created November 24, 2014 07:03
A ImageMagick Script Can Generate Color Palettes JSON Format. Usage: ./colors.sh IMAGE-PATH COLOR-NUMBERS eg: ./colors.sh /Users/Cyril/Downloads/photo2.jpg 10
dir="." #Set the default temp dir
tmpA1="$dir/spectrumhist_1_$$.png"
tmpB1="$dir/spectrumhist_1_$$.cache"
trap "rm -f $tmpA1 $tmpB1; exit 0" 0 #remove temp files
trap "rm -f $tmpA1 $tmpB1; exit 1" 1 2 3 15 #remove temp files
if [ $# -eq 2 ]
then
colors=$2
else
colors=8
@addyosmani
addyosmani / package.json
Last active December 28, 2024 12:07
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",
@ashishb
ashishb / gist:da145a877139fcd91e3f
Created July 6, 2014 08:36
Fix for "Unapproved caller. SecurityAgent may only be invoked by Apple software"
- Start on single user mode: Hit the Command and S keys at start-up
Wait until the writing stops completely
-At the line, type (after root): /sbin/fsck -fy (space after the k)
Hit the ENTER key
wait until it finishes and says "... appears to be OK"
next, type: /sbin/mount -uw / (space after the t and after the w)
@Chaser324
Chaser324 / GitHub-Forking.md
Last active May 5, 2025 09:32
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@andyearnshaw
andyearnshaw / README.md
Created April 26, 2014 23:32
Simple KeyboardEvent.key polyfill

Recently, I've been working on a Smart TV application targeted at both LG and Samsung models. I had problems keeping the main code platform independent because the key codes on events generated by the remote controls differed between the vendors. While LG's remote control keys generated fairly sane codes, Samsung's didn't, with the codes for numeric keys seeming completely random (for example, the numeric key 1 has the key code 101, but 5 has 9).

I eventually decided to polyfill KeyboardEvent.key, and allow passing a map to the polyfill so that the platform-dependent code could define their own keysets.

The property exposes itself on both the KeyEvent (non-standard) and KeyboardEvent (standard) objects and is ideal for use in specific, targeted environments.

@blackfalcon
blackfalcon / git-feature-workflow.md
Last active May 3, 2025 02:39
Git basics - a general workflow

Git-workflow vs feature branching

When working with Git, there are two prevailing workflows are Git workflow and feature branches. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited, and the focus of this article.

If you are new to Git and Git-workflows, I suggest reading the atlassian.com Git Workflow article in addition to this as there is more detail there than presented here.

I admit, using Bash in the command line with the standard configuration leaves a bit to be desired when it comes to awareness of state. A tool that I suggest using follows these instructions on setting up GIT Bash autocompletion. This tool will assist you to better visualize the state of a branc

@mbostock
mbostock / .block
Last active April 1, 2025 07:55
Closest Point on Path
license: gpl-3.0
@dhigginbotham
dhigginbotham / EmailClients.json
Created November 14, 2013 21:50
EmailClients.json
{
"@media": {
"Outlook 2007/10/13 +": "No",
"Outlook 03/Express/Mail": "No",
"iPhone iOS 7/iPad": "Yes",
"Outlook.com": "No",
"Apple Mail 6.5": "Yes",
"Yahoo! Mail": "No",
"Google Gmail": "No",
"Android 4 (Gmail) +": "No"
@hofmannsven
hofmannsven / README.md
Last active April 30, 2025 15:25
Git CLI Cheatsheet