Skip to content

Instantly share code, notes, and snippets.

View robwalch's full-sized avatar

Rob Walch robwalch

View GitHub Profile
@robwalch
robwalch / jw6-event-delegation.js
Last active August 29, 2015 14:06
JW Player event delegation example
var jw = jwplayer('jwplayer').setup({file:"videofile.mp4"});
var noop = function() {/* do nothing */}
var timeDelegate = noop;
jw.onTime(timeDelegate);
jw.onPlaylistItem(function(itemEvent) {
if (itemEvent.index === 1) {
var RollingSpider = require('rolling-spider');
//discover.js
var drone = new RollingSpider({
// uuid: ['RS_W179234'],
logger: console.log
// forceConnect: true
});
console.log('drone', drone);
@robwalch
robwalch / hack.sh
Created April 2, 2012 22:51 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@robwalch
robwalch / hack.sh
Created April 2, 2012 22:20 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@robwalch
robwalch / gbgrep
Created August 2, 2012 17:04 — forked from nas/gbgrep
git blame with grep
#!/usr/local/bin/ruby
grep = `git grep -n #{ARGV[0]} #{ARGV[1]}`
files = grep.scan /.*\:\d+/
interrupt = false
files.each do |file_with_line|
exit if interrupt
@robwalch
robwalch / robot.js
Created December 1, 2012 02:16
minimonk
var r = 19, Robot = function(e) {
this.data = {}, this.time = 0, this.arenaTopLeft = {x: r,y: r}, this.arenaTopRight = {x: e.arenaWidth - r,y: r}, this.arenaBottomLeft = {x: r,y: e.arenaHeight - r}, this.arenaBottomRight = {x: e.arenaWidth - r,y: e.arenaHeight - r}, this.arenaCenter = {x: e.arenaWidth / 2,y: e.arenaHeight / 2}, this.target1 = null, this.target2 = null
}, p = Robot.prototype;
(function() {
var e = r, t = r * r, n = 20, i = 2, s = 50, o = 50;
p.sub = function(e, t) {
return {x: e.x - t.x,y: e.y - t.y}
}, p.add = function(e, t) {
return {x: e.x + t.x,y: e.y + t.y}
}, p.neg = function(e) {
@robwalch
robwalch / robot.js
Created December 4, 2012 13:49
Pretty
var r = 19, Robot = function(e) {
this.data = {}, this.time = 0, this.arenaTopLeft = {x: r,y: r}, this.arenaTopRight = {x: e.arenaWidth - r,y: r}, this.arenaBottomLeft = {x: r,y: e.arenaHeight - r}, this.arenaBottomRight = {x: e.arenaWidth - r,y: e.arenaHeight - r}, this.arenaCenter = {x: e.arenaWidth / 2,y: e.arenaHeight / 2}, this.target1 = null, this.target2 = null
}, p = Robot.prototype;
(function() {
var e = r, t = r * r, n = 20, i = 2, s = 50, o = 50;
p.sub = function(e, t) {
return {x: e.x - t.x,y: e.y - t.y}
}, p.add = function(e, t) {
return {x: e.x + t.x,y: e.y + t.y}
}, p.neg = function(e) {
@robwalch
robwalch / robot.js
Created December 8, 2012 08:38
HAWTBAWT
var r = 19;//Math.ceil(Math.sqrt(27 * 27 + 24 * 24)/2); // Tank Dimensions: 27, 24
var Robot = function(robot) {
this.data = {};
// MOVE_INCREMENT = 1, ANG_INCREMENT = 1;
this.time = 0;
this.arenaTopLeft = {x: r, y: r};
this.arenaTopRight = {x: robot.arenaWidth -r, y: r};
this.arenaBottomLeft = {x: r, y: robot.arenaHeight -r};
/*
This script extends jwplayer api instances with a `_history`
property which is a hash of event types including "all".
After including this on the page, to check if a "play" event fired,
call `jwplayer()._history.play`. Initially this returns `undefined`.
Once the event is fired an array is populated with an object for each
event fired.
The `jwplayer()._history.all` array will always be present and contains
@robwalch
robwalch / index.html
Created December 8, 2015 01:31 — forked from anonymous/index.html
Buffering // source http://jsbin.com/wokoraz
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Buffering</title>
<style>
.ranges {
height: 20px;
position: relative;
width: 400px;