Skip to content

Instantly share code, notes, and snippets.

View BobGneu's full-sized avatar
🤖

Bob Chatman BobGneu

🤖
View GitHub Profile
sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
if (typeof Object.addEventListener !== 'function')
{
Object.addEventListener = function (name, fn)
{
// If this object has yet to have any events attached, create a new object.
if (!this.events)
this.events = {};
@BobGneu
BobGneu / Flathead.cpp
Created May 16, 2014 18:56
Example of object encapsulation
void Flathead::DefineLoggingFunctions(Local<ObjectTemplate> globalTemplate)
{
HandleScope scope(GetIsolate());
Handle<Context> context = Context::New(GetIsolate());
Context::Scope ContextScope(context);
Local<FunctionTemplate> log_tmp = FunctionTemplate::New(GetIsolate());
log_tmp->PrototypeTemplate()->Set(String::NewFromUtf8(GetIsolate(), "log", String::kInternalizedString), FunctionTemplate::New(GetIsolate(), Flathead::LogCallback));
@BobGneu
BobGneu / mathtests.js
Created May 16, 2014 19:36
Example of JS Testing in Flathead | calling UMath functions from JS, running assertions on them in a sandbox.
(function () {
// Namespace UMath
assert(typeof UMath === "object", "UMath is supposed to be defined as an object");
// constants
assert(typeof UMath.PI === "number", "PI is a number");
assert(UMath.PI === 3.1415927410125732, "PI is supposed to be 3.1415927410125732 - " + UMath.PI);
assert(typeof UMath.SMALL_NUMBER === "number", "SMALL_NUMBER is a number");
@BobGneu
BobGneu / v8init.bat
Created September 12, 2014 04:11
Initialize V8 - 3.29.59
git clone https://github.com/v8/v8.git ./
git checkout tags/3.29.59
svn co http://gyp.googlecode.com/svn/trunk build/gyp --revision 1831
svn co http://src.chromium.org/svn/trunk/tools/third_party/python_26 third_party/python_26 --revision 89111
svn co http://src.chromium.org/svn/trunk/deps/third_party/cygwin third_party/cygwin --revision 66844
svn co https://src.chromium.org/chrome/trunk/deps/third_party/icu52 third_party/icu --revision 277999
svn co http://googletest.googlecode.com/svn/trunk testing/gtest --revision 643
svn co http://googlemock.googlecode.com/svn/trunk testing/gmock --revision 410
python ./build/gyp_v8 -Dtarget_arch=x64
@BobGneu
BobGneu / demo.conf
Created September 12, 2014 04:18
Demo node upstart definition
bob_gneu@badassmofo.google.com:~$ cat /etc/init/demo.conf
#!upstart
description "Node Demo"
author "bob@gneu.org"
env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
respawn
start on startup
@BobGneu
BobGneu / 000-default
Created September 15, 2014 22:56
Apache redirect to Node Application =)
<VirtualHost *:80>
ServerName subdomain.yourdomain.com
ProxyPreserveHost on
ProxyPass / http://localhost:3000/
</VirtualHost>
@BobGneu
BobGneu / Difficulties.csv
Created October 4, 2014 16:52
UE4 - DataTable Demo from Exodus
InitialUniversePopulation InitialUniverseResources InitialPlanetPopulation InitialPlanetResources Planets Bounds ResourceConsumptionRate OrbitScale LaunchTimer PopulationTimer ResourcesTimer LowPopulationGrowthRate EvenPopulationGrowthRate HighPopulationGrowthRate NoResourcesGrowthRate LowPopulationRatio EvenPopulationRatio OrbitTime MaxOrbits LaunchVelocity DeepSpace CargoSpace CrewMinimum Gravitation
Easy 4000 100000 852 1200 10 1024 0.0005 2 5 5 5 0.012 -0.042 0.001 -0.3 0.5 0.7 15 5 200 1536 250 50 1.8
Medium 3200 80000 805 1080 13 1536 0.0015 2.1 4.75 4.75 4.75 0.0144 -0.0504 0.0012 -0.36 0.525 0.735 15.75 5.45 360 2304 300 60 2.16
Hard 2560 64000 802 1026 16 2304 0.003 2.205 4.5125 4.5125 4.5125 0.0173 -0.0605 0.0014 -0.432 0.5513 0.7718 16.5375 5.9405 648 3456 360 72 2.592
Insane 2048 51200 800 975 20 3456 0.006 2.3153 4.2869 4.2869 4.2869 0.0207 -0.0726 0.0017 -0.5184 0.5788 0.8103 17.3644 6.4751 1166.4 5184 432 86.4 3.1104
APlanet *AExodusGameMode::CreatePlanet()
{
FVector Location = FVector::ZeroVector;
APlanet *planet;
planet = GetWorld()->SpawnActor<APlanet>(Location, FRotator::ZeroRotator);
check(planet != NULL);