Skip to content

Instantly share code, notes, and snippets.

@codenamegary
codenamegary / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@codenamegary
codenamegary / Person.php
Last active August 29, 2015 13:59 — forked from amcsi/Person.php
<?php
namespace MyProject;
class Person
{
private $data;
/**
*
@codenamegary
codenamegary / gist:7015030
Last active December 25, 2015 17:39 — forked from s3gfau1t/gist:7014684
ERMAHGERD IF/ELSE! $raceWriter('Message to console or file.');
<?php
$velocities = array("turtle", "donkey", "rabbit");
$mode = isset($argv[1]) ? $argv[1] : 'console';
$file = isset($argv[2]) ? $argv[2] : '';
$fp = null;
$raceWriters = array(
'file' => function($output)use($file, $fp){
if(!$fp) $fp = fopen($file, 'a+');
<?php
$velocities = array("turtle", "donkey", "rabbit");
$players = array(
'1' => array(
'name' => 'Foo',
'velocity' => $velocities[rand(0,2)],
'actions' => array(),
),
'2' => array(
<?php
$velocities = array("turtle", "donkey", "rabbit");
$players = array(
'1' => array(
'name' => 'Foo',
'velocity' => $velocities[rand(0,2)],
'actions' => array(),
),
'2' => array(
@codenamegary
codenamegary / gist:7013392
Last active December 25, 2015 17:29 — forked from s3gfau1t/gist:7013352
Added actions and actionsFunc
<?php
$velocities = array("turtle", "donkey", "rabbit");
$players = array(
'1' => array(
'name' => 'Foo',
'velocity' => $velocities[rand(0,2)]),
'actions' => array(),
'2' => array(
'name' => 'Bar',
<?php
$velocities = array("turtle", "donkey", "rabbit");
$players = array(
'1' => array(
'name' => 'Foo',
'velocity' => $velocities[rand(0,2)]),
'2' => array(
'name' => 'Bar',
'velocity' => $velocities[rand(0,2)]),
<?php
$velocities = array("turtle", "donkey", "rabbit");
$players = array(
'1' => array(
'name' => 'Foo',
'velocity' => $velocities[rand(0,2)]),
'2' => array(
'name' => 'Bar',
'velocity' => $velocities[rand(0,2)]),
75.126.19.144/28
75.126.23.16/28
173.193.185.248/29
184.173.69.128/28
50.22.39.192/28
50.97.157.0/26
75.126.59.16/28
108.168.247.192/27
173.193.171.136/29
173.193.179.248/29
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.