Skip to content

Instantly share code, notes, and snippets.

View moimikey's full-sized avatar
:shipit:
ship it

Michael Scott Hertzberg moimikey

:shipit:
ship it
View GitHub Profile
@moimikey
moimikey / gist:d3421d389dbb4db38faf
Last active June 15, 2016 13:54
npm search /\^is-
is-4byte-char Check if a given value is a character that costs 4 bytes in… =shinnn
is-4byte-code-point Check if a given number is a code point of UTF-8 4-byte… =shinnn
is-7z Check if a Buffer/Uint8Array is a 7Z archive =t1st3
is-7zip Check if a Buffer/Uint8Array is a 7ZIP file =kevva
is-a type checking "micro library" =dtudury
is-a-ray is it a Ray? Is it? IS IT? =gypsydave5
is-absolute Polyfill for node.js `path.isAbolute`. Returns true if a… =jonschlinkert…
is-absolute-url Check if an URL is absolute =sindresorhus
is-accessor-descriptor Returns true if a value has the characteristics of a valid… =jonschlinkert
is-admin
@moimikey
moimikey / colors.js
Last active August 23, 2022 17:08
colors!
var colors = {
indigo: "#4b0082",
gold: "#ffd700",
hotpink: "#ff69b4",
firebrick: "#b22222",
indianred: "#cd5c5c",
yellow: "#ffff00",
mistyrose: "#ffe4e1",
darkolivegreen: "#556b2f",
olive: "#808000",

Keybase proof

I hereby claim:

  • I am moimikey on github.
  • I am moimikey (https://keybase.io/moimikey) on keybase.
  • I have a public key whose fingerprint is 1AD5 03A4 5B61 7D24 92F9 C20A E6F5 36D1 51B6 701F

To claim this, I am signing this object:

@moimikey
moimikey / coolbeans
Created December 2, 2014 21:25
coolbeans
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !(wp-content|wp-admin) [NC]
RewriteRule ^(.*/\d{4})/\d{2}/\d{2}(.*)$ /$1$2 [R=301,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
@moimikey
moimikey / app.js
Created November 8, 2014 19:34
quick and easy es6 in the browser
import $ from 'jquery';
export class Zomg {
constructor() {
console.log('es6!', $('body'));
}
}
new Zomg
@moimikey
moimikey / config.js
Created October 21, 2014 01:29
ultimate webpack config. work in progress...
module.exports = {
port: 8000,
globals: {
$: 'jquery',
jQuery: 'jquery',
_: 'lodash',
Backbone: 'backbone',
Marionette: 'backbone.marionette',
moment: 'moment'
},
# Detect `y` scroll direction of mousewheel event
Util.scrollDirection = (evt) ->
if evt.detail < 0 or evt.wheelDelta > 0 then 'up' else 'down'
# absolute document height
Util.getDocumentHeight = ->
Math.max document.body.scrollHeight or 0,
document.documentElement.scrollHeight or 0,
document.body.offsetHeight or 0,
document.documentElement.offsetHeight or 0,
document.body.clientHeight or 0,
document.documentElement.clientHeight or 0
Util.isElementInViewOf = (el, parent) ->
el = el[0] if el instanceof jQuery
parent = parent[0] if parent instanceof jQuery
return unless el? and parent?
rect = el.getBoundingClientRect()
rect.top >= 0 and
rect.left >= 0 and
rect.bottom <= parent.clientHeight and
Util.isElementInViewport = (el) ->
el = el[0] if el instanceof jQuery
return unless el?
rect = el.getBoundingClientRect()
rect.top >= 0 and
rect.left >= 0 and
rect.bottom <= (window.innerHeight or document.documentElement.clientHeight) and
rect.right <= (window.innerWidth or document.documentElement.clientWidth)