Skip to content

Instantly share code, notes, and snippets.

squashin bugs.

nick comer nkcmr

squashin bugs.
View GitHub Profile
View nick-comer-io.less
@xs: 0;
@sm: 544px;
@md: 768px;
@lg: 992px;
@xl: 1200px;
@xs-up: "only screen and (min-width:#{lower-bound($medium-range)})";
body {
font-family: 'Source Code Pro', monospace;
nkcmr / cephei.php
Last active Apr 9, 2016
cephei - a tiny css pre-processor, written in php
View cephei.php
function cephei($selector, $properties) {
$output = sprintf("%s {\n", $selector);
$children = [];
foreach ($properties as $property => $value) {
if (is_array($value)) {
$children[$property] = $value;
} else {
$output .= sprintf(" %s: %s;\n", $property, $value);
View ejson.php
$foo = '{"bar":{"$date":1358205756553},"pop":{"goes":{"err":{"$binary":"c3VyZS4="},"the":{"weasel":{"$date":1358205756553,"$tz":"America/New_York"}}}}}';
class EJSON {
protected static $customTypes = [];
public static function type($marker, $decoder) {
if (!is_callable($decoder)) {
nkcmr / check-sw-reg.js
Last active Aug 29, 2015
push api zumba blog
View check-sw-reg.js
// the service worker api entry point is navigator.serviceWorker
.then(function (registration) {
// 'registration' is an instance of ServiceWorkerRegistration, see here:
if (!registration) {
// there is no service worker installed!
} else {
// there is one installed, and it is either 'waiting'
nkcmr /
Last active Apr 23, 2017
simple deluge complete scope that uploads stuff to google drive

deluge to google drive uploader

simple uploader script for deluge, assign this script to be called on torrent complete and it will walk a directory and upload it to your google drive

install dependencies:

npm install googleapis async winston lodash mime twilio
nkcmr / the-beast-of-a-regex.js
Created Mar 16, 2015
best working email regex for javascript [updated]
View the-beast-of-a-regex.js
* i say updated because previously, the regex wouldn't
* like if you entered, '', which with
* recently added TLDs is a perfectly valid email address.
* So i looked up the maximum length for a TLD (which is
* 63 characters), and put it in here. Now it works pretty well.
* It even acceptes those GMail aliases (
var EMAIL_REGEX = /^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.({2,63})|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i
nkcmr / scrollIntoView.js
Created Feb 4, 2015
View scrollIntoView.js
define([], function() {
function stripWrapper(ele) {
return (ele instanceof jQuery || ele instanceof angular.element) ? ele[0] : ele;
function getRect(el) {
el = stripWrapper(el);
return _.pick(el.getBoundingClientRect(), 'top', 'left', 'bottom', 'right', 'width', 'height');
View gist:9b9ec0a62481ca387ef9

Send a request to:, and it returns this:

  "width": 360,
  "author_url": "",
  "title": "Idk Animated GIF",
  "url": "",
  "image": "",
  "provider_url": "",
nkcmr / gist:3853630202c157fc7686
Created May 16, 2014
View gist:3853630202c157fc7686
Date: Fri, 16 May 2014 11:50:25 -0400
From: Nick Comer
Message-ID: <etPan.537633c1.6b8b4567.2c2@alpha.local>
Subject: Please Uphold Strict Net Neutrality
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
I could write a drawn out, multi-page essay on the reasons that net
nkcmr / spdy.js
Created Feb 11, 2014
replacing https with spdy
View spdy.js
var express = require("express");
var app = express();
var https = require("https");
https.createServer({ /*options and ssl stuff*/ }, app).listen(443);
var spdy = require("spdy");
spdy.createServer({ /*options and ssl stuff*/ }, app).listen(443);