Skip to content

Instantly share code, notes, and snippets.

View tuxsudo's full-sized avatar
💭
mostly working in private codebases

Jared Anderson tuxsudo

💭
mostly working in private codebases
View GitHub Profile
@tuxsudo
tuxsudo / LetterFX-Demo.markdown
Created April 10, 2014 18:41
A Pen by Jared Anderson.
@tuxsudo
tuxsudo / SassMeister-input.scss
Created August 7, 2014 21:28
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.0.rc.1)
// ----
.test{
color: darken(#066f93, 5%);
color: darken(#066f93, 10%);
color: darken(#066f93, 20%);
color: darken(#066f93, 30%);
@tuxsudo
tuxsudo / .babelrc
Created October 12, 2015 22:52 — forked from tgroshon/.babelrc
Babel for Node 4
{
"blacklist": [
"es3.memberExpressionLiterals",
"es3.propertyLiterals",
"es5.properties.mutators",
"es6.blockScoping",
"es6.classes",
"es6.constants",
"es6.arrowFunctions",
"es6.spec.symbols",
function delay(time, callback) {
setTimeout( ()=>callback(`Slept for ${time}`), time);
}
function run(generatorFunction) {
var iterator = generatorFunction(resume);
function resume(callbackValue) {
function* spinner() {
while( true ) {
yield '\\';
yield '|';
yield '/'
yield '-';
}
}
@tuxsudo
tuxsudo / index.html
Created October 15, 2015 20:51
Web Component
<!DOCTYPE html>
<html>
<head>
<link rel="import" href="./my-tabs.html">
</head>
<body>
--log_gc (Log heap samples on garbage collection for the hp2ps tool.)
type: bool default: false
--expose_gc (expose gc extension)
type: bool default: false
--max_new_space_size (max size of the new generation (in kBytes))
type: int default: 0
--max_old_space_size (max size of the old generation (in Mbytes))
type: int default: 0
--max_executable_size (max size of executable memory (in Mbytes))
type: int default: 0
@tuxsudo
tuxsudo / formialize.js
Last active November 30, 2015 00:18
Serialize Form Contents
export default form => {
let determineValue = elm => {
switch (elm.type) {
case "file":
return elm.files;
case "checkbox":
@tuxsudo
tuxsudo / splitEvery.js
Created December 15, 2015 16:30
Split an array into N number of chunks
export default ( chunkLength = 20 , sourceArray = [] ) => (
sourceArray.reduce( (accumulated, current, index) => {
let chunkN = Math.floor( index/chunkLength );
accumulated[ chunkN ] = ( accumulated[ chunkN ]||[]).concat( current );
return accumulated;
}, [])
);
export function dedupeByMatchingObjectsValues( keys , arrayOfObjects ) {
return arrayOfObjects.filter( (item, i, inArray) => (
inArray.find( target => (
[].concat(keys).reduce( (bool, key) => bool && item[ key ]===target[ key ], true)
))===item
));
}