Skip to content

Instantly share code, notes, and snippets.

View arbalest's full-sized avatar

Ethan Horger arbalest

View GitHub Profile
@arbalest
arbalest / package_node_app.bat
Created August 23, 2013 18:20
Batch file that zips up a node-webkit application folder and launches it in one step. Assumes the following: 1. That 7-zip is installed (alter path on line 5) 2. That this script is placed alongside "nw.exe" and that the application files are stored in a folder named "app", relative to this script
if exist app.nw (
del app.nw
)
cd app
"C:\Program Files\7-Zip\7z.exe" a -tzip ../app.nw *
cd ../
nw.exe app.nw
@arbalest
arbalest / runAction.js
Last active December 27, 2015 14:59
Pass a dot separated string representation of a method (e.g. "MyApp.Utilities.calculateSomething") to be called on the window without using eval.
/**
* Given a string, such as "MyNamespace.MyClass.MyMethod",
* this function will check for and execute a corresponding
* method on the window.
*/
function runAction(action) {
var pieces = action.split('.');
var pieceCount = pieces.length;
var base = window;
@arbalest
arbalest / CanvasJS_Game_Loop_Template_v01.html
Created November 11, 2013 23:14
Canvas / Javascript game loop template
<!DOCTYPE html>
<html>
<head>
<title>Canvas / Javascript Game Template</title>
</head>
<body>
<style type="text/css">
html, body {
margin: 0;
padding: 0;
@arbalest
arbalest / config.js
Created June 17, 2014 20:13
Underscore Templates: Handlebar-Style Configuration
/**
* templateSettings object to configure Underscore's template engine to use Mustache-like curly-brace syntax.
*/
_.templateSettings = {
evaluate: /\{\{#([\s\S]+?)\}\}/g, // {{# console.log("pikachu!") }}
interpolate: /\{\{[^#\{]([\s\S]+?)[^\}]\}\}/g, // {{ title }}
escape: /\{\{\{([\s\S]+?)\}\}\}/g, // {{{ title }}}
}
@arbalest
arbalest / app-frame-layout-1.html
Created June 18, 2014 14:39
HTML5 / CSS3 "frameset" style layout with a toolbar, fixed width side panel and dynamic width main panel
<!doctype html>
<html>
<head>
<title>App Layout Base | Method #1 | Fixed Toolbar : Fixed Sidebar Panel : Fluid Main Panel</title>
<style type="text/css">
html, body {
height: 100%;
}
body {
@arbalest
arbalest / video-ui-demo.html
Created June 20, 2014 22:01
Demonstrates Video player ui with a text input inside a button and video shaking animation when an invalid item is entered
<!doctype html>
<html>
<head>
<title>Video Player UI Demo | 2014-06-20</title>
<!--
<link href="//vjs.zencdn.net/4.6/video-js.css" rel="stylesheet"/>
<script src="//vjs.zencdn.net/4.6/video.js"></script>
-->
<link href="lib/video-js/video-js.css" rel="stylesheet"/>
@arbalest
arbalest / instructions.md
Created July 3, 2014 15:29
Run Linux X Application without Desktop Environment
@arbalest
arbalest / iscroll_5_fixed_sidebar.html
Last active August 29, 2015 14:04
iScroll 5 Fixed Sidebar Basic Template
<!doctype html>
<html>
<head>
<title>iScroll Fixed Sidebar Template</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/iScroll/5.1.1/iscroll-min.js"></script>
<style>
html, body {
margin: 0;
padding: 0;
@arbalest
arbalest / main.css
Last active August 29, 2015 14:08
Quick Snap CSS Cubic Bezier Animation Timing Params
.quickSnap {
-webkit-transition-timing-function: cubic-bezier(0.060, 0.975, 0.195, 0.985);
-moz-transition-timing-function: cubic-bezier(0.060, 0.975, 0.195, 0.985);
-o-transition-timing-function: cubic-bezier(0.060, 0.975, 0.195, 0.985);
transition-timing-function: cubic-bezier(0.060, 0.975, 0.195, 0.985); /* custom */
}
@arbalest
arbalest / main.js
Created December 1, 2014 22:52
WIP LCD System
var canvas = document.getElementById('canvas');
window.reqFrame = window.webkitRequestAnimationFrame || window.requestAnimationFrame;
/* System */
var System = {
BG_COLOR: '#fafafa',
PX_COLOR_100: '#222222',
PX_COLOR_75: '#656565',
PX_COLOR_50: '#999999',
PX_COLOR_25: '#cccccc',