Skip to content

Instantly share code, notes, and snippets.

Uncaught TypeError: Cannot set property 'exports' of undefined main.js:9200
defineExport main.js:9200
browserifyShim main.js:9198
browserifyShim main.js:9200
(anonymous function) main.js:9204
require.AyKrkQ main.js:9206
s main.js:1
(anonymous function) main.js:1
require../core/button.js main.js:9215
s main.js:1
@jmshal
jmshal / test.js
Created March 21, 2015 06:35
Playing around with DataView and ArrayBuffer in JavaScript...
var typeReference = [
['Byte', 'Int8' ],
['UnsignedByte', 'Uint8' ],
['Short', 'Int16' ],
['UnsignedShort', 'Uint16' ],
['Long', 'Int32' ],
['UnsignedLong', 'Uint32' ],
['Float', 'Float32'],
['Double', 'Float64']
];
@jmshal
jmshal / boo_watching.md
Created September 28, 2015 22:25
boo_watching.md

HI HERE ARE SOME DOG HALP *** SORRY HE IS SO GODDAMN DIRTY ***

Boo Sitting (March 15-19th) 15th: Afternoon/PM 16th: AM/Afternoon/PM 17th: AM/PM 18th: AM/PM 19th: AM/PM

@branneman
branneman / better-nodejs-require-paths.md
Last active April 27, 2024 04:16
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@jmshal
jmshal / better-nodejs-require-paths.md
Created November 14, 2015 00:43 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@MartinEesmaa
MartinEesmaa / youtube_formats.md
Last active April 27, 2024 04:16 — forked from AgentOak/youtube_formats.md
Youtube Format IDs

Note: This is all almost full YouTube ID informations. Original owner goes to AgentOak, modified version by Martin Eesmaa.

See the credits and also special thanks in below.

Last updated: April 2024

Also known as itag or format codes and way back they could be specified with the fmt parameter (e.g. &fmt=22). Depending on the age and/or popularity of the video, not all formats will be available.

DASH video

@jmshal
jmshal / index.js
Last active April 27, 2024 04:15
npm i --save gist:9ccd7fce7eefb63cd118a217636e31a6
'use strict';
/**
* Resize an image (from URL). Ensures that the images is contained within the bounding box.
*
* @param {string} url The image URL
* @param {number} width The maximum image width
* @param {number} height The maximum image height
* @param {boolean} [padding] Whether to include padding if the image doesn't fit perfectly
* @returns {Promise<string>}
@jmshal
jmshal / index.js
Created October 6, 2016 09:54
npm i --save gist:53c856c340000421fd7d9fc794b23086
'use strict';
const TEST_OVERFLOW = /(auto|scroll)/;
/**
* Scrolls to an element by scrolling it's parent scroll container.
*
* @param {Element} element The element to scroll to
* @param {boolean} [center] Whether to center the element within it's scroll container
*/
{
"1": "Bulbasaur",
"2": "Ivysaur",
"3": "Venusaur",
"4": "Charmander",
"5": "Charmeleon",
"6": "Charizard",
"7": "Squirtle",
"8": "Wartortle",
"9": "Blastoise",