Skip to content

Instantly share code, notes, and snippets.

View jonathanmarvens's full-sized avatar

Jonathan Barronville jonathanmarvens

View GitHub Profile
@jonathanmarvens
jonathanmarvens / README.md
Created September 18, 2017 05:28 — forked from mutewinter/README.md
Prevent Double Tap Zoom in React for Rapidly Tapped Buttons

Prevent Double Tap Zoom in React for Rapidly Tapped Buttons

Touch delay is [a thing of the past][td], but accidental zooming is here to ruin your day. Ever tapped a button quickly on iOS and experienced a zoom instead of two taps? You're in the right place.

Before

Before

// Generates a graph that shows n levels of the Collatz Conjecture.
var reverseCollatz = function(r, max) {
function compute() {
var level = {1: 1},
results = {},
index = {};
for (var c=1; c<max; c++) {
var newlevel = {};
module.exports = function (properties) {
var object = Object.create(null)
if ((typeof properties !== 'undefined') &&
(properties !== null) &&
(typeof properties === 'object')) {
for (var property in properties) {
if (properties.hasOwnProperty(property)) {
object[property] = properties[property]
}
@jonathanmarvens
jonathanmarvens / gist:4d8ef268c0e65a0ce0ea
Created February 16, 2016 16:22 — forked from eevee/gist:55426e5856f5825317b1
adblock rules to hide mentions from people who don't follow you

Pop open "filter preferences" in adblock plus, and add the following rules to hide mentions from people who don't follow you (and who you don't follow).

For the interactions/notifications page:

twitter.com##.interaction-page [data-follows-you="false"][data-you-follow="false"]:not(.my-tweet)

For the mentions page:

twitter.com##.mentions-page [data-follows-you="false"][data-you-follow="false"]:not(.my-tweet)
const a = [4, 1, 9, 6, 5]
const b = [0, 3, 5, 2, 7]
const universe = new Set(a.concat(b))
const bSet = new Set(b)
let complement = new Set(Array.from(universe).filter((member) => ! bSet.has(member)))
@jonathanmarvens
jonathanmarvens / google_twunter_lol
Created February 8, 2016 10:25 — forked from jamiew/google_twunter_lol
All the dirty words from Google's "what do you love" project: http://www.wdyl.com/
easterEgg.BadWorder.list={
"4r5e":1,
"5h1t":1,
"5hit":1,
a55:1,
anal:1,
anus:1,
ar5e:1,
arrse:1,
arse:1,
function f(str)
local outer_env = _ENV
return (str:gsub("%b{}", function(block)
local code = block:match("{(.*)}")
local exp_env = {}
setmetatable(exp_env, { __index = function(_, k)
local stack_level = 5
@jonathanmarvens
jonathanmarvens / gist:28979ec94a978b930736
Created January 2, 2016 13:42 — forked from zliuva/gist:1084476
A minimal Mach-o x64 executable for OS X
; A minimal Mach-o x64 executable for OS X (also see below Mountain Lion version)
;
; $ nasm -f bin -o tiny_hello tiny_hello.s
; $ chmod +x tiny_hello
; $ ./tiny_hello
; Hello World!
; $
; c.f.
; http://osxbook.com/blog/2009/03/15/crafting-a-tiny-mach-o-executable/ ( the original tiny mach-o executable )
/**
****************************************************************************
* Copyright 2015 Jonathan Barronville <[email protected]> *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
[
{
"code": "AF",
"name": "Afghanistan"
},
{
"code": "AX",
"name": "Aland Islands"
},
{