Skip to content

Instantly share code, notes, and snippets.

View hworld's full-sized avatar
♨️
playing magic

hworld

♨️
playing magic
View GitHub Profile
// JS
function GJAPI_AuthUser( objectName, functionName )
{
unity.getUnity().SendMessage( objectName, functionName, "username:token" );
}
// Unity
// Once the game is ready to login...
Application.ExternalCall( "GJAPI_AuthUser", "GameObject", "AuthUser" );
@hworld
hworld / mootstrap.grid.styl
Created January 10, 2014 17:19
Better mootstrap
make-row( gutter-width = $grid-gutter-width )
@extend .clearfix
margin-left: -(gutter-width / 2)px
margin-right: @margin-left
make-grid-breakpoint( breakpoint, columns = $grid-columns )
// Loop in reverse to cascade correctly for precedence.
// It's super hacky, but I don't know of a different way to do it in Stylus.
for col-index in 1..columns
@hworld
hworld / stream_twitch.sh
Created November 7, 2013 17:31
Little gist for streaming to Twitch from Linux.
#! /bin/bash
# originally from http://tinyurl.com/twitch-linux from taladan
# www.youtube.com/user/taladan
# script created by brodul
# modified by yours truly: CROS
# You obviously must make sure ffmpeg is installed on your OS.
INRES="1920x1080" # input resolution (The resolution of the program you want to stream!)
@hworld
hworld / gist:6629699
Created September 19, 2013 20:54
For GA event tracking.
/**
* Make sure you use this to track any clicks. It does more than just track().
* @param {Event} event The event object for the click event.
* @param {Object} elem The actual DOM element.
* @param {string} category
* @param {string} action
* @param {string} label
* @param {string} value
*/
trackClick: function( event, elem, category, action, label, value )
@hworld
hworld / gist:5910929
Created July 2, 2013 16:41
For easily tracking events in GA.
var EventTracking = {
init: function()
{
$( '.ga-event' ).on( 'click', function(){
var event_data = $( this ).data( 'ga-event' );
if ( event_data )
{
var pieces = event_data.split( ':' );
EventTracking.track( pieces[0], pieces[1], pieces[2], pieces[3] );
@hworld
hworld / gist:5892260
Created June 29, 2013 19:02
Nodejs pubsub client
var http = require( 'http' );
http.globalAgent.maxSockets = 150
var host = 'api-01.gamejolt.com';
var gameId = 1;
var totalResponses = 0;
var prev = 0;
if ( true ) {