Skip to content

Instantly share code, notes, and snippets.

View samshull's full-sized avatar
🎯
Focusing

Sam Shull samshull

🎯
Focusing
View GitHub Profile
@samshull
samshull / api.md
Last active January 24, 2020 23:24 — forked from AdamMagaluk/api.md
EpicMix Mobile API
http://www.epicmix.com/vailresorts/sites/epicmix/api/mobile/mountains.ashx
http://www.epicmix.com/vailresorts/sites/epicmix/api/mobile/weather.ashx
http://www.epicmix.com/vailresorts/sites/epicmix/api/mobile/terrain.ashx
http://www.epicmix.com/vailresorts/sites/epicmix/api/mobile/lifts.ashx
http://www.epicmix.com/vailresorts/sites/epicmix/api/mobile/mountaincams.ashx
http://www.epicmix.com/vailresorts/sites/epicmix/api/mobile/roadconditions.ashx
@samshull
samshull / gist:fe4ea1f14396387f4f6d
Last active August 29, 2015 14:06
simplifying method_missing functionality with Proxy
var root = (function(){ return this; })();
function ProxyClass() {
if (this === root) throw Error();
var instance = this;
return Proxy.create({
get: function(receiver, name) {
console.log('get', name);
return instance[name] || (instance._get && instance._get(name, receiver)) || undefined;
},
@samshull
samshull / robot.js
Created December 3, 2012 17:37 — forked from cezarsa/robot.js
Simple Wall Robot
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
robot.turnGunRight(90);
robot.clone();
this.direction = 1;
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(1);
if (robot.parentId) {
@samshull
samshull / robot.js
Created December 3, 2012 17:36
W00t #1 YEAH!!!! (Zolmesiter)
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
//robot.turnGunRight(90);
robot.clone();
this.direction = 1;
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(1);
if (robot.parentId) {
@samshull
samshull / robot.js
Created December 3, 2012 17:01
destroyer of worlds
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot;
robot = ev.robot;
@samshull
samshull / gist:4046632
Created November 9, 2012 16:22
the metrics of numbers
module Metric
PREFIXES = {
:yotta => 8,
:zetta => 7,
:exa => 6,
:peta => 5,
:tera => 4,
:giga => 3,
:mega => 2,
:kilo => 1,
@samshull
samshull / gist:4026270
Created November 6, 2012 17:41
ranges that support unicode characters and dates (sort of)
(function() {
var StopIterator = this.StopIterator || function() { Error.apply(this, arguments); };
function Range(/*[start, ] stop [, step [, exclusive]]*/) {
var args = Array.prototype.slice.call(arguments, 0);
if (!(this instanceof Range)) return Range.apply(new Range(1), args);
switch(args.length) {
@samshull
samshull / hack.sh
Created November 6, 2012 17:37 — 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
#
@samshull
samshull / gist:4026233
Last active October 12, 2015 12:27
Iterative jQuery methods that use a single jQuery object for context to simplify usage
(function($){
$.fn.$each = function(callback) {
var $temp = $([1]);
return this.each(function() {
$temp[0] = this;
return callback.apply($temp, arguments);
});
};