Skip to content

Instantly share code, notes, and snippets.

View jwir3's full-sized avatar

Scott Johnson jwir3

View GitHub Profile
@jwir3
jwir3 / gist:11191699
Created April 22, 2014 19:39
WebAPICommunicatorAuthenticatedTest
package com.jingit.mobile.api.test;
import java.util.concurrent.*;
import org.json.JSONException;
import org.json.JSONObject;
import android.location.Location;
import android.os.Handler;
import android.test.InstrumentationTestCase;
@jwir3
jwir3 / gist:11259018
Created April 24, 2014 15:33
Shortcode Resolver
//-----------------------------------------------------------------------
// EXPERIENCE_TYPE
// Created by bradbenson
// Copyright (c) 2014 by Jingit LLC
// All Rights Reserved
//
//
package com.jingit.mobile;
openPaths: ({pathsToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode}) ->
console.log "***** DEBUG_jwir3 TEST"
for pathToOpen in pathsToOpen ? []
console.log "***** DEBUG_jwir3: pathToOpen: #{pathToOpen}"
@openPath({pathToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode})
@jwir3
jwir3 / BumpVersionTask.groovy
Last active August 29, 2015 14:07
gradle default task
// Located at: buildSrc/src/main/groovy/BumpVersionTask.groovy
class BumpVersionTask extends DefaultTask {
@TaskAction
def bumpVersion(String aVersionString) {
println "***** DEBUG_jwir3: " + aVersionString
}
}
@jwir3
jwir3 / gist:9a8a6481f324c13664aa
Last active August 29, 2015 14:08
GSoC Mentor Summit 2014 - FOSS Gaming Session

Packaging

  • Are steam games required to run on Windows?
  • Difference between open source games and games for linux
    • Wordforge uses a number of different dependencies/libraries.
    • Game companies have perfect control over dependencies; Worldforge needs to package everything and setup dependency trees.
    • Steam makes things really easy to package and distribute; No need to bring up package manager to install dependencies.
    • On Android
      • Main C lib on Android is called Bionic. Sometimes, things need to be fixed (e.g. a POSIX problem with the library), but this causes a problem with a specific game.
      • Worst case for Android is that developers need to be notified.
  • If relying on a quirk or bug in a given library, then that game will break. The solution for Windows is to bundle the C library with the game.
@jwir3
jwir3 / .vimrc
Created November 18, 2014 19:51
Whitespace Highlighting
" Highlight extraneous whitespace
:highlight ExtraWhitespace ctermbg=red guibg=red
:autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red
@jwir3
jwir3 / WhenIWork-JavaCodeStyle.xml
Last active September 24, 2015 15:46
Code Style
<code_scheme name="WhenIWork-JavaCodeStyle">
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
@jwir3
jwir3 / WhenIWork.xml
Created May 1, 2015 19:29
Android Studio Error Configuration
<?xml version="1.0" encoding="UTF-8"?>
<inspections version="1.0">
<option name="myName" value="Project Default" />
<option name="myLocal" value="true" />
</inspections>
@jwir3
jwir3 / check-commits-for-compilation.sh
Last active September 13, 2016 14:29
Check Commits for Compilation
#!/bin/bash
# Replace this with the command you want to run. It must exit with an
# appropriate return code (i.e. nonzero on error) for it to work with this
# script.
COMMAND="./gradlew installAlphaDebug -q"
GIT_DIR="./.git"
check() {
@jwir3
jwir3 / canvasArrowhead.js
Created May 18, 2017 15:18
Code to create an arrowhead on an html5 canvas
/**
* Draw an arrowhead on a line on an HTML5 canvas.
*
* Based almost entirely off of http://stackoverflow.com/a/36805543/281460 with some modifications
* for readability and ease of use.
*
* @param context The drawing context on which to put the arrowhead.
* @param from A point, specified as an object with 'x' and 'y' properties, where the arrow starts
* (not the arrowhead, the arrow itself).
* @param to A point, specified as an object with 'x' and 'y' properties, where the arrow ends