Skip to content

Instantly share code, notes, and snippets.

View jethrolarson's full-sized avatar
:shipit:

Jethro Larson jethrolarson

:shipit:
  • Tableau
  • Seattle
View GitHub Profile

Jank (software)

  1. adj. Something that technically functions but is poorly implemented, hacky, or in desperate need of refactoring.
  2. n. Studdering or tearing that appears when scrolling an unperformant user interface.

###Examples###

  1. "The first release of Windows 10 is hella jank"
  2. "There's a lot of jank when scrolling on mobile tumblr"
@jethrolarson
jethrolarson / combinators.js
Last active January 15, 2018 19:36
combinators in es6
// [BCKW](https://en.wikipedia.org/wiki/B,C,K,W_system)
// compose
var B = f => g => a => f(g(a))
// flip
var C = f => a => b => f(b)(a)
// Const
var K = a => b => a
@jethrolarson
jethrolarson / future_example.js
Last active August 29, 2015 14:23
Playing with Future
var R = require('ramda');
var Future = require('ramda-fantasy').Future;
//Wrap ajax in a future
//:: String -> Future String
var fetch = function(url) {
return new Future(function(rej, res){
var oReq = new XMLHttpRequest();
oReq.addEventListener("load", res, false);
oReq.addEventListener("error", rej, false);
oReq.addEventListener("abort", rej, false);
// ==UserScript==
// @name Ramda filter
// @namespace http://jethrolarson.github.io
// @version 0.1
// @description Alternative search for ramda docs
// @author Jethro Larson
// @match http://ramdajs.com/*/docs/
// @grant none
// ==/UserScript==
React = require 'react'
{map} = require 'ramda'
{div, ul, li, button} = require ('./tag')
React.render ( div [
div [
'Assets:',
ul map ((a)-> li [a.type]), w.player.assets
]
button {onClick: act 'hurtAliens'}, 'Hurt aliens'
button {onClick: act 'getHelp'}, 'Get help'
alert('win');
@jethrolarson
jethrolarson / gist:7074296
Created October 20, 2013 19:41
What do you need in an html document
1. <!doctype html> - Always first
2. <html lang="en-us">
2.5. <head> - Usually 3rd but technically optional
3. <meta charset="utf-8"/> - Ensures the rest of the document is interpreted correctly. Be sure this value isn't a lie.
4. <meta http-equiv="X-UA-Compatible" content="IE=edge"/> - Makes IE render the document correctly
5. <title>title</title> - Put should be before imports and after the encoding issues to prevent xss vulnerability
6. <link rel="stylesheet"... - Prevent FOUC
7. everything else
macro bf {
case ($body ...) => {
eval('var p = 0, b = [], buf = new Buffer(1);');
_bf($body ...);
}
}
macro _bf {
case (>) => {
eval('p++;');
}
// Adds Support for localStorage to IE5-IE7 using userData
// <http://msdn.microsoft.com/en-us/library/ms531424(VS.85).aspx>
// See also <http://caniuse.com/#feat=namevalue-storage>
if(typeof window.localStorage === 'undefined') (function () {
var userdataKey = 'localStorage',
userdata = document.createElement('b');
userdata.style.display = 'none';
userdata.style.behavior = 'url("#default#userData")';
var $w = $(window);
function imageHolder() {
//Organize our thumbs
var iThumb = 1, firstImage;
$('#album-thumbs > ul > li').each(function() {
if(iThumb === 1) {
$(this).addClass('current');