Skip to content

Instantly share code, notes, and snippets.

View jasonhazel's full-sized avatar
💜

Jason Hazel jasonhazel

💜
View GitHub Profile
<?php
class Foo
{
public function Run() {}
}
class Bar
{
public function Run() {}
function Module($filePath, $attributes)
{
// Usage: Module('templateName.php', array('var1' => 'val1', 'var2' => 'val2', 'foo' => 'bar'))
//-- get Fusebox var in order to set also the circuit that has initiated the Module call
$a_Fusebox =& get_fusebox();
$parentCircuit = $a_Fusebox['circuit'];
$isModule = true;
$myPath = getcwd() . '/';
<?php
$template_path = 'pages/public/';
$main_template = 'main.tmpl';
if(isset($_GET['p']))
$file = basename($_GET['p']) . '.tmpl';
else
$file = 'default.tmpl';
@jasonhazel
jasonhazel / action.php
Created September 2, 2012 22:39
r/PHPHelp
d
@jasonhazel
jasonhazel / light_controller.php
Created November 10, 2012 00:43
unprovoked rewrite of schwippy tree script.
<?php
// create the light controller and assign the color codes.
$lights = new LightController(
//-- our color codes
array(
'blue' => 'G5',
'white' => 'G6',
'green' => 'G7',
'red' => 'G8'
)
@jasonhazel
jasonhazel / light_controller.php
Created November 10, 2012 00:46
Unprovoked rewrite of Schwippy Tree script.
<?php
// create the light controller and assign the color codes.
$lights = new LightController(
//-- our color codes
array(
'blue' => 'G5',
'white' => 'G6',
'green' => 'G7',
'red' => 'G8'
)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Date Picker BETA</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
D, [2013-05-22T23:43:50.901223 #21072] DEBUG -- : Message received: {"command"=>"heartbeat"}
D, [2013-05-22T23:43:50.901453 #21072] DEBUG -- : Message sent: {:clientid=>"1369251745-0.5909271742404202", :userid=>"500f57bcaaa5cd670f0002f4", :userauth=>"[REMOVED]", :status=>"available", :api=>"presence.update", :msgid=>18}
D, [2013-05-22T23:43:50.971345 #21072] DEBUG -- : Message received: {"msgid"=>18, "now"=>1369251830.956435, "success"=>true, "interval"=>30, "command"=>"response_received"}
D, [2013-05-22T23:44:02.971306 #21072] DEBUG -- : Message received: {"command"=>"heartbeat"}
D, [2013-05-22T23:44:02.971537 #21072] DEBUG -- : Message sent: {:clientid=>"1369251745-0.5909271742404202", :userid=>"500f57bcaaa5cd670f0002f4", :userauth=>"[REMOVED]", :status=>"available", :api=>"presence.update", :msgid=>19}
D, [2013-05-22T23:44:03.043157 #21072] DEBUG -- : Message received: {"msgid"=>19, "now"=>1369251843.028318, "success"=>true, "interval"=>30, "command"=>"response_received"}
D, [2013-05-22T23:44:06.647828 #21
# https://www.bloc.io/ruby-warrior
class Player
def initialize
@health = 20
@begining = false
@action = false
@direction = :backward
end
def play_turn(warrior)
require 'watir'
require 'open-uri'
SEARCHES = ARGV[0] ? ARGV[0].to_i : 90
def utf(string)
string.force_encoding('UTF-8')
end
browser = Watir::Browser.new :firefox, :profile => 'default'