Skip to content

Instantly share code, notes, and snippets.

View mspanish's full-sized avatar

Stacey Reiman mspanish

View GitHub Profile
@tezzutezzu
tezzutezzu / index.html
Last active February 27, 2017 22:53
Pixi integration in d3
<html>
<head>
<title>Pixi integration in d3</title>
<style> html,body {padding:0; margin:0}</style>
</head>
<body>
<script src="https://d3js.org/d3.v4.min.js"></script>
@john-doherty
john-doherty / javascript-trim-svg-whitespace.js
Created October 21, 2016 13:39
Trim whitespace from SVG elements
function trimSvgWhitespace() {
// get all SVG objects in the DOM
var svgs = document.getElementsByTagName("svg");
// go through each one and add a viewbox that ensures all children are visible
for (var i=0, l=svgs.length; i<l; i++) {
var svg = svgs[i],
box = svg.getBBox(), // <- get the visual boundary required to view all children
@philngo
philngo / ccss.csv
Last active May 15, 2024 00:41
Common Core State Standards CSV
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 8 columns, instead of 7. in line 7.
id,content_type,category_id,category_name,grade_id,grade_name,item,description
CCSS.ELA-LITERACY.L.K.1,ELA-LITERACY,L,Language,K,Kindergarten,1,Demonstrate command of the conventions of standard English grammar and usage when writing or speaking.
CCSS.ELA-LITERACY.L.K.1.a,ELA-LITERACY,L,Language,K,Kindergarten,1a,Print many upper- and lowercase letters.
CCSS.ELA-LITERACY.L.K.1.b,ELA-LITERACY,L,Language,K,Kindergarten,1b,Use frequently occurring nouns and verbs.
CCSS.ELA-LITERACY.L.K.1.c,ELA-LITERACY,L,Language,K,Kindergarten,1c,"Form regular plural nouns orally by adding /s/ or /es/ (e.g., dog, dogs; wish, wishes)."
CCSS.ELA-LITERACY.L.K.1.d,ELA-LITERACY,L,Language,K,Kindergarten,1d,"Understand and use question words (interrogatives) (e.g., who, what, where, when, why, how)."
CCSS.ELA-LITERACY.L.K.1.e,ELA-LITERACY,L,Language,K,Kindergarten,1e,"Use the most frequently occurring prepositions (e.g., to, from, in, out, on, off, for, of, by, with)."
CCSS.ELA-LITERACY.L.K.1.f,ELA-LITERACY,L,Language,K,Kindergarten,
@paulirish
paulirish / what-forces-layout.md
Last active July 20, 2024 17:43
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@joonaspaakko
joonaspaakko / Illustrator convert to legacy.jsx
Last active December 30, 2023 10:48
Finds all Illustrator files from the input folder + its subfolders and converts them to an older version.
// https://gist.github.com/joonaspaakko/df2f9e31bdb365a6e5df
// Finds all .ai files from the input folder + its subfolders and converts them to the version given below in a variable called "targetVersion"
// Tested in Illustrator cc 2014 (Mac)
// Didn't bother to do a speed test with my macbook air...
#target illustrator
// If set to false, a new file will be written next to the original file.
// This script exports illustrator layers as individual PNGs.
//
// author: Nathan Sweet
// author: Ivan Gadzhega
// rev: 10
const L2PNG_NAMESPACE = "http://esotericsoftware.com/l2png";
const L2PNG_PREFIX = "l2png:";
const IGNORE_HIDDEN_LAYERS_ID = "ignoreHiddenLayers";
@borlaym
borlaym / animals.json
Created December 15, 2014 13:38
Array of animal names
[
"Aardvark",
"Albatross",
"Alligator",
"Alpaca",
"Ant",
"Anteater",
"Antelope",
"Ape",
"Armadillo",
@drmalex07
drmalex07 / README-create-debian-startup-script.md
Last active September 29, 2023 11:42
An example of how to create a init.d script in Debian, using dependency booting. #debian #init.d #lsb-script #startup-script
@NathanSweet
NathanSweet / Illustrator-LayersToPNG.jsx
Last active October 15, 2018 06:53
Adobe Illustrator script to export to Esoteric Software's Spine: http://esotericsoftware.com/
Please note this script has moved: https://github.com/EsotericSoftware/spine-scripts
@bradberger
bradberger / script.js
Created July 30, 2014 07:33
Promise-based JS script loader
function script(url) {
if(Array.isArray(url)) {
var self = this, prom = [];
url.forEach(function(item) {
prom.push(self.script(item));
});
return Promise.all(prom);
}