Skip to content

Instantly share code, notes, and snippets.

View davidkryzaniak's full-sized avatar

David Kryzaniak davidkryzaniak

View GitHub Profile
@davidkryzaniak
davidkryzaniak / hgrc
Created January 29, 2014 14:52 — forked from matagus/hgrc
[extensions]
# enable color extension
color =
[color]
# configure colors for each possible hg status
status.modified = blue bold
status.added = green bold
status.removed = red bold
status.deleted = cyan bold
<?php
$db = Zend_Db_Table::getDefaultAdapter();
$adapter = new Zend_Paginator_Adapter_DbSelect(
$db->select()
->from('readings')
->where("verified = 'p'")
);
$rowCount = $db->fetchRow("SELECT COUNT(*) AS total FROM readings WHERE verified = 'p'");
$adapter->setRowCount(
<?php
$select = $db->select()->from(
'roi_misc',
array('miscId','accountCode','savings','other','remarks')
)->joinUsing(
'roi_misc_presets',
'presetId',
array('bucket','presetName')
);
<?php
//get the class
require_once('/path/to/flightaware/FlightAware.class.php');
$flightaware = new FlightAware();
/* Optionally, you can skip the config.ini and pass an array into the constructor
* $flightaware = new FlightAware(
* array("username"=>"","apiKey"=>"","requestURL"=>"flightxml.flightaware.com/json/FlightXML2/")
* );
@davidkryzaniak
davidkryzaniak / 0.php
Created April 19, 2014 21:13
W3 Total Cache Config
<?php
return array(
'version' => '0.9.3',
'cluster.messagebus.debug' => false,
'cluster.messagebus.enabled' => false,
'cluster.messagebus.sns.region' => '',
'cluster.messagebus.sns.api_key' => '',
'cluster.messagebus.sns.api_secret' => '',
'cluster.messagebus.sns.topic_arn' => '',
<?php
//Get the body of the request
$body = file_get_contents("php://input");
if(!empty($body)){
$alertData = json_decode($body,TRUE);
//Save to database... or other stuff
}else{
throw new Exception("Invalid Request");
Array
(
[long_desc] => "Southwest #442 arrived at Minneapolis/St Paul Intl (KMSP) at 09:20AM CDT from KMKE (General Mitchell Intl) Destination (Minneapolis/St Paul Intl / MSP): Gate H8"
[short_desc] => "SWA442 arrived at KMSP from KMKE"
[summary] => "SWA442 arrived at KMSP from KMKE"
[eventcode] => "arrival"
[alert_id] => "6993590"
[flight] => Array
(
[ident] => "SWA442"
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Pause length="10"/>
<Say voice="alice" language="en-gb">
Southwest #2426 (B737) departed Port Columbus Intl (KCMH) at 01:30PM EDT enroute to KMDW (Chicago Midway Intl) for an estimated arrival at 01:20PM CDT
Destination (Chicago Midway Intl / MDW): Gate B19
</Say>
</Response>
<?php
/**
* User: @davidkryzaniak
* Date: 6/10/14
* Time: 15:10
*/
class FuzzyDate{
private $SECOND = 1;
@davidkryzaniak
davidkryzaniak / Tomato_Device_List.php
Created July 7, 2014 03:46
Poll router (Tomato) for active devices on the network
<?php
/**
* Returns an array of devices currently on the network
*
* Created by PhpStorm.
* User: davidkryzaniak
* Date: 06/07/2014
* Time: 22:05
*/