Skip to content

Instantly share code, notes, and snippets.

@newshorts
newshorts / slider.html
Created September 30, 2011 08:01
simple slider managed by google closure and css3 transitions for effects
<!--
No License, if you feel like giving me credit for something...my name's Mike.
http://iwearshorts.com/
README:
This example requires you install google closure (http://code.google.com/closure/library/docs/gettingstarted.html) and make the library available. Put this file next to the closure-library directory and you should be able to run it without a problem.
It uses some closure tools to manage the slider positions. It also uses css3 transitions for effect. Don't use this for production as it won't be compatible with all major browsers (http://www.findmebyip.com/litmus).
@newshorts
newshorts / app.js
Created June 2, 2012 04:13
Video Player with Clickable area to click part of the video and drag
/*
* Author: Mike Newell
*
* iwearshorts.com
*
* Feel free to copy and do whatever, but if you think it's cool, give me some credit.
*
**/
var App = function() {
@newshorts
newshorts / main.m
Created April 4, 2014 02:04
Objective C application for determining if one of your 99 problems is a bitch?
//
// main.m
// NinetyNineProblems
//
// Created by Mike Newell on 4/3/14.
// Copyright (c) 2014 Mike Newell. All rights reserved.
//
#import <Foundation/Foundation.h>
@newshorts
newshorts / colors.json
Last active August 29, 2015 13:59
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.
["0,0,0",
"35,0,1",
"71,1,2",
"107,2,6",
"142,4,10",
"178,6,16",
"214,9,21",
"249,13,27",
"1,35,2",
"36,36,2",
<html>
<body>
<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>
</body>
<script>
navigator.getUserMedia({video: true}, function(stream) {
var video = document.getElementById("v");
var canvas = document.getElementById("c");
@newshorts
newshorts / index.html
Created April 29, 2014 07:30
Very Simple File Upload for NodeJS with Express
<form class="mediaForm" enctype="multipart/form-data">
<input name="file" type="file" class="media" />
<input type="submit" name="submit" class="submit" />
</form>
@newshorts
newshorts / background_subtraction_webcam
Last active August 29, 2015 14:05
Background subtraction processing with opencv
// This will show background subtraction from your webcam in processing using:
// https://github.com/atduskgreg/opencv-processing
import gab.opencv.*;
import processing.video.*;
import java.awt.*;
//Movie video;
Capture video;
OpenCV opencv;
@newshorts
newshorts / gist:a3193b9ce6cfcb7738ac
Created October 27, 2014 23:52
Run NPM without sudo, installed on mac with brew
# 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
newshorts / ShowHideTransitionEnd.js
Created August 20, 2015 23:24
A small script to show and hide an element based on the event of css transition end
var COVER;
var Cover;
(function($) {
COVER = function() {
// private
var __ = this;
var $cover = $('#cover');
var isShowing = false;
// public
@newshorts
newshorts / Gruntfile.js
Last active October 7, 2015 18:03
Grunt file for chester for chester chester for chester
module.exports = function(grunt) {
require('grunt-task-loader')(grunt);
grunt.initConfig({
dir: {
src: "Source",
dist: "Deploy",
tmp: ".tmp"
},
clean: {