Skip to content

Instantly share code, notes, and snippets.

View elebetsamer's full-sized avatar

Eric Lebetsamer elebetsamer

  • Electronic Arts
  • Bay Area, CA
View GitHub Profile
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
using System.Reflection;
/**
* Used in the game code to know how to treat an object
* This isn't needed here, but I'm using it to determine if we can reuse an object
* instead of instantiating it.
var crc32 = (function() {
function utf8encode(str) {
var utf8CharCodes = [];
for (var i = 0, len = str.length, c; i < len; ++i) {
c = str.charCodeAt(i);
if (c < 128) {
utf8CharCodes.push(c);
} else if (c < 2048) {
utf8CharCodes.push((c >> 6) | 192, (c & 63) | 128);
'use strict';
var ENV = process.env.NODE_ENV || 'local';
var gulp = require('gulp');
var gutil = require('gulp-util');
var bower = require('bower');
var concat = require('gulp-concat');
var gulpif = require('gulp-if');
var less = require('gulp-less');
@lelandrichardson
lelandrichardson / ko-convenience.js
Created March 5, 2014 01:11
Knockout.js Custom Utility Bindings
(function (ko, handlers, unwrap, extend) {
"use strict";
extend(handlers, {
href: {
update: function (element, valueAccessor) {
handlers.attr.update(element, function () {
return { href: valueAccessor() };
});
}
},
@jrschumacher
jrschumacher / build-and-deploy.sh
Last active April 23, 2019 17:38
Ionic Automated Build and Deploy to HockeyApp
#!/bin/bash
PROJECT_NAME=MyApp
SCHEME_NAME=MyApp
STARTTIME=$(date +%s);
set -e
set -x
### Install dependencies
echo "--- Install dependencies [Time Elapsed $(($(date +%s) - $STARTTIME))s]"
@marcocarnazzo
marcocarnazzo / 030_update_platform_config.js
Last active May 31, 2019 15:31
Ionic/Cordova update platform config
#!/usr/bin/env node
/** This hook updates platform configuration files based on preferences and config-file data defined in config.xml.
Currently only the AndroidManifest.xml and IOS *-Info.plist file are supported.
See http://stackoverflow.com/questions/28198983/ionic-cordova-add-intent-filter-using-config-xml
Preferences:
1. Preferences defined outside of the platform element will apply to all platforms
2. Preferences defined inside a platform element will apply only to the specified platform
@theangryangel
theangryangel / AuthController.js
Created February 28, 2013 21:54
sails (v0.8.82) + passport + passport-local Rough Example. For the love of all that is holy, don't use this in production.
// api/controllers/AuthController.js
var passport = require('passport');
var AuthController = {
login: function (req,res)
{
res.view();
},
@aberke
aberke / gist:042eef0f37dba1138f9e
Last active June 20, 2020 05:17
AngularJS module for phonenumber inputs - Includes custom directive that formats telephone number input values as well as filter for format them in text.
/***************************************************
----------------------------------------------------
Author: Alexandra Berke (aberke)
Written: Summer 2014
----------------------------------------------------
Formats the phonenumber as (222) 333-4444 within the input element
Binds only the number 2223334444 to the model
@DavidFrahm
DavidFrahm / 020_build_version.js
Last active December 28, 2020 00:05
Cordova build hook, to use build version from config.xml in your hybrid app
#!/usr/bin/env node
// This plugin replaces text in a file with the app version from config.xml.
var wwwFileToReplace = "js/build.js";
var fs = require('fs');
var path = require('path');
var rootdir = process.argv[2];
@barryvdh
barryvdh / colorbox.less
Created March 10, 2012 18:49
Colorbox skin for Bootstrap
/*
ColorBox Core Style:
The following CSS is consistent between example themes and should not be altered.
*/
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:10001; overflow:hidden;}
#cboxOverlay{position:fixed; width:100%; height:100%;}
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
#cboxContent{position:relative;}
#cboxLoadedContent{overflow:auto;}
#cboxTitle{margin:0;}