Skip to content

Instantly share code, notes, and snippets.

View davidkryzaniak's full-sized avatar

David Kryzaniak davidkryzaniak

View GitHub Profile
@davidkryzaniak
davidkryzaniak / web920_example.php
Created October 21, 2013 23:57
Web920 Shortcodes
<?php
/**
* Plugin Name: Web920 Shortcode Example
* Description: This is an example plugin
* Version: 1.0
* Author: David Kryzaniak
* Author URI: http://dave.kz
*/
a.fancy-button:visited,
a.fancy-button{
color: #FFF;background-color: #5CB85C;text-decoration: none;
border-color: #4CAE4C;display: inline-block;padding: 6px 12px;margin-bottom: 0;
font-size: 14px;font-weight: normal;line-height: 1.428571429;text-align: center;
white-space: nowrap;vertical-align: middle;cursor: pointer;background-image: none;
border: 1px solid rgba(0, 0, 0, 0);border-radius: 4px;-webkit-user-select: none;
-moz-user-select: none;-ms-user-select: none;-o-user-select: none;user-select: none;
}
.custom-background .site-header-banner {background-color:#F2F0ED !IMPORTANT;}
@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"