Skip to content

Instantly share code, notes, and snippets.

View jwir3's full-sized avatar

Scott Johnson jwir3

View GitHub Profile
### Keybase proof
I hereby claim:
* I am jwir3 on github.
* I am jwir3 (https://keybase.io/jwir3) on keybase.
* I have a public key whose fingerprint is 924D 4BEE 15AF DA10 F983 5368 896B 8DF7 786D 9D05
To claim this, I am signing this object:
@jwir3
jwir3 / git.sh
Last active June 23, 2023 20:44
PATH_TO_YUBIKEY_PRESENT_SCRIPT=/some/path/to/yubikey-present.sh
function git() {
if [[ "$1" == "commit" && $(${PATH_TO_YUBIKEY_PRESENT_SCRIPT}) == "true" ]]; then
shift 1
command git commit -S "$@"
else
command git "$@"
fi
}
@jwir3
jwir3 / yubikey-present.sh
Created June 23, 2023 20:30
Script for checking whether a yubikey is present
#!/bin/bash
#
# A script to determine if a yubikey is present on the current host
#
RESULT=`2>&1 gpg --card-status`
CARD_ABSENT=`echo $RESULT | grep "OpenPGP card not available"`
if [ -z "${CARD_ABSENT}" ]
then
SAVEIFS=$IFS # Save current IFS (Internal Field Separator)
@jwir3
jwir3 / fractal.js
Created November 12, 2019 20:32
Fractal Configuration
'use strict';
const pkg = require('./package.json');
const exportStylesheetToGlobalContext = require('./config/sass-email-context');
const context = {
package: {
name: pkg.name,
version: pkg.version,
path: '../../dist'
@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
@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 / 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 / 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 / .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 / 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.