Skip to content

Instantly share code, notes, and snippets.

View mattbenic's full-sized avatar

Matt Benic mattbenic

View GitHub Profile
@mattbenic
mattbenic / index.php
Created February 13, 2012 11:01
PHP script to bulk import issues to a GitHub repo from a .json file
<?php
/* PHP script to bulk import issues in json format from a file to a GitHub repository
*
* The json in the uploaded file should contain an array of issues at the top level.
* Fields in the json mapped to the issue title and body (nothing else is supported)
* are specified in the submission form.
*
* Depends on the php-github-api from here: https://github.com/ornicar/php-github-api
*/
@mattbenic
mattbenic / gist:761041
Created December 31, 2010 14:13
Evaluation order pseudocode
function evalTest(val1, val2, val3)
{
print("val1: "+val1+", val2: "+val2+", val3: "+val3);
}
int val = 0;
int arr = { ++val, ++val, ++val };
print("arr: ["+arr[0]+", "+arr[1]+", "+arr[2]+"]");
@mattbenic
mattbenic / gist:761039
Created December 31, 2010 14:12
Testing evaluation order in actionscript
function evaluationTest(val1:Number, val2:Number, val3:Number) {
trace("val1: "+val1+", val2: "+val2+", val3: "+val3);
}
var val:Number = 0;
var arr:Array = [++val, ++val, ++val];
trace("arr: ["+arr[0]+", "+arr[1]+", "+arr[2]+"]");
val = 0;
evaluationTest(++val, ++val, ++val);
@mattbenic
mattbenic / gist:761035
Created December 31, 2010 14:11
Testing evaluation order in Java
int val = 0;
int[] arr = {++val, ++val, ++val};
System.out.println("arr: ["+arr[0]+", "+arr[1]+", "+arr[2]+"]");
val = 0;
evaluationTest(++val, ++val, ++val);
void evaluationTest(int val1, int val2, int val3) {
System.out.println("val1: "+val1+", val2: "+val2+", val3: "+val3);
}
$this->pdo = new PDO("mysql:host=".$this->host."; dbname=".$this->databaseName,
$this->user, $this->password,
array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
/**
* Play the game.
*/
public function playGame():Void
{
gotoAndStop("Level");
}
import us.benic.matt.Menu;
/**
* Button for the Flash Workflow demonstration.
* @author Matt Benic
*/
class us.benic.matt.Button extends MovieClip
{
/**
* Creates a new button and sets it's onRelease to notify the Menu instance.
import us.benic.matt.App;
/**
* Menu for the Flash Workflow demonstration.
* @author Matt Benic
*/
class us.benic.matt.Menu extends MovieClip
{
/**
* Play button.
/**
* Handles an onRelease event.
* @param source The MovieClip that triggered the onRelease event.
*/
public function onButtonReleaseHandler(source:MovieClip):Void
{
switch(source) {
case playBtn:
App.getInstance().playGame();
break;
import us.benic.matt.App;