Skip to content

Instantly share code, notes, and snippets.

newshorts / gist:3e6ec66dff1c970223dafb9cd7cb59ab
Created Jul 17, 2019
get commits since a date time in graphql
View gist:3e6ec66dff1c970223dafb9cd7cb59ab
let { repository } = await graphql(`{
repository(owner: "${owner}", name:"${repoName}") {
object(expression: "${branch}") {
... on Commit {
history(first: 100, since: "${since}") {
nodes {
newshorts / alphanum.txt
Last active Nov 5, 2016
Alphanumeric string - because I can't find anywhere to copy this!!!
View alphanum.txt
newshorts / download-s3.bash
Created Sep 17, 2016
Boot up aws cli and download batch images
View download-s3.bash
brew install awscli
aws configure
# 1. log into your aws console, click on "security and credentials" in the menu
# 2. access your IAM page, create a new user & group with access to your bucket
# 3. copy credentials to a safe spot
# AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
# Default region name [None]: us-west-2
newshorts / Gruntfile.js
Last active Oct 7, 2015
Grunt file for chester for chester chester for chester
View Gruntfile.js
module.exports = function(grunt) {
dir: {
src: "Source",
dist: "Deploy",
tmp: ".tmp"
clean: {
newshorts / ShowHideTransitionEnd.js
Created Aug 20, 2015
A small script to show and hide an element based on the event of css transition end
View ShowHideTransitionEnd.js
var COVER;
var Cover;
(function($) {
COVER = function() {
// private
var __ = this;
var $cover = $('#cover');
var isShowing = false;
// public
newshorts / gist:a3193b9ce6cfcb7738ac
Created Oct 27, 2014
Run NPM without sudo, installed on mac with brew
View gist:a3193b9ce6cfcb7738ac
# using Homebrew
# Note: `brew install npm` has problems, as of 2010-12-30.
# hopefully it will eventually be good and happy.
# As of npm@0.2.13, however, this is an option
PREFIX=$(brew --prefix)
# take ownership
# this will also let homebrew work without using sudo
newshorts / background_subtraction_webcam
Last active Aug 29, 2015
Background subtraction processing with opencv
View background_subtraction_webcam
// This will show background subtraction from your webcam in processing using:
import gab.opencv.*;
import java.awt.*;
//Movie video;
Capture video;
OpenCV opencv;
newshorts / index.html
Created Apr 29, 2014
Very Simple File Upload for NodeJS with Express
View index.html
<form class="mediaForm" enctype="multipart/form-data">
<input name="file" type="file" class="media" />
<input type="submit" name="submit" class="submit" />
View getusermedia_picture.html
<video id="v" width="300" height="300"></video>
<input id="b" type="button" disabled="true" value="Take Picture"></input>
<canvas id="c" style="display:none;" width="300" height="300"></canvas>
navigator.getUserMedia({video: true}, function(stream) {
var video = document.getElementById("v");
var canvas = document.getElementById("c");
newshorts / colors.json
Last active Aug 29, 2015
Translate any rgb value to 256 8-bit colors and back. Use the 'color' value as a key to the array in the json file.
View colors.json