Skip to content

Instantly share code, notes, and snippets.

View nkcmr's full-sized avatar

nick comer nkcmr

View GitHub Profile
@nkcmr
nkcmr / keybase.md
Created April 21, 2018 19:38
keybase.md

Keybase proof

I hereby claim:

  • I am nkcmr on github.
  • I am nkcmr (https://keybase.io/nkcmr) on keybase.
  • I have a public key whose fingerprint is 82D8 9697 B0E4 8E64 4E78 259A 1423 50B6 4205 77DE

To claim this, I am signing this object:

@nkcmr
nkcmr / goto.sh
Last active March 6, 2019 15:54
goto.sh
#!/bin/bash
goto() {
# create the shortcuts dir if necessary
if [ ! -d "$HOME/.shortcuts" ] ; then
mkdir -p "$HOME/.shortcuts"
fi
if [[ "$1" == "--list" ]] ; then
for f in "$HOME/.shortcuts/"* ; do
echo "$(basename "$f") -> $(tr -d '\n' < "$f")"
@nkcmr
nkcmr / main.go
Created June 11, 2017 18:37
a concurrent network diagnostic tool of sorts
package main
import (
// "io/ioutil"
"bytes"
"encoding/json"
"fmt"
"io"
"os"
"os/exec"
@nkcmr
nkcmr / ad-tracker-block.js
Last active August 10, 2016 20:27
ad/tracker blocker that works at a system level
'use strict'
const blacklist = [
/analytics/,
/fullstory/,
/amplitude/,
/crashlytics\.com/,
/doubleclick\.net/,
/chartbeat\.(net|com)/,
/deepintent\.com/,
@nkcmr
nkcmr / bmrk.php
Created August 10, 2016 13:06
poor man's php benchmark
<?php
define("BENCH_ITERATIONS", 1000);
$scenarios = [];
// scenario one
$scenarios['one'] = function () {
$start = microtime(true);
// do stuff in between the microtimes
return microtime(true) - $start;

Keybase proof

I hereby claim:

  • I am nkcmr on github.
  • I am nkcmr (https://keybase.io/nkcmr) on keybase.
  • I have a public key ASBCQWHPkNbeLwUL7moC-LL6vSSGgGzDRtkFuR6covWMXQo

To claim this, I am signing this object:

@nkcmr
nkcmr / cephei.php
Last active April 9, 2016 18:29
cephei - a tiny css pre-processor, written in php
<?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);
<?php
date_default_timezone_set('UTC');
$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
nkcmr / check-sw-reg.js
Last active August 29, 2015 14:20
push api zumba blog
// the service worker api entry point is navigator.serviceWorker
navigator.serviceWorker
.getRegistration()
.then(function (registration) {
// 'registration' is an instance of ServiceWorkerRegistration, see here:
// http://www.w3.org/TR/service-workers/#service-worker-registration-interface
if (!registration) {
// there is no service worker installed!
} else {
// there is one installed, and it is either 'waiting'
@nkcmr
nkcmr / README.md
Last active April 23, 2017 10:18
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