Skip to content

Instantly share code, notes, and snippets.

View sbward's full-sized avatar
🌱
plant-powered programming

Sam Ward sbward

🌱
plant-powered programming
  • Wellington, New Zealand
  • 05:58 (UTC +12:00)
View GitHub Profile
// Segment.io tracking: which modules were selected?
var props = {};
var $chkboxes = $('.module-option input[type=checkbox]');
$chkboxes.each(function() {
props[$(this).attr('name')] = $(this).attr('checked');
});
analytics.trackForm(form, 'Build Created', props);
<div id="footer">
<span id="footer-img"><img src="/images/logo-sm.png" width="58" height="22" alt="ZingCharts" /></span>
<div class="nav">
<?php
$menu = array("Home"=>"$prefix/", "Download"=>"http://www.zingchart.com/download/", "Purchase"=>"$securePrefix/store/buy.php", "Learn"=>"/reference/", "Support"=>"$prefix/support/", "About"=>"$prefix/about/", "Privacy"=>"$prefix/privacy/", "Terms"=>"$prefix/legal/tc.php", "Site Map"=>"$prefix/sitemap/", "White Papers"=>"$prefix/assets/pdf/zc-brochure.pdf");
foreach ($menu as $key => $value){
if ($current_location == $key){
echo $key . " ";
} else if ($key == "White Papers") {
echo "<a href='$value' target='_blank' id='white_papers_link'>$key</a> ";
$('#tools li').each(function() {
analytics.trackLink($(this), 'Social Link', {
platform: $(this).attr('title')
});
});
<ul data-zc-options id="track_render">
<li class="active">HTML 5</li>
<li>Flash</li>
<li>SVG</li>
<li>Image</li>
<li>VML</li>
</ul>
{
"class": [ "order" ],
"properties": {
"orderNumber": 42,
"itemCount": 3,
"status": "pending"
},
"entities": [
{
"class": [ "items", "collection" ],
{
"href": "http://api.x.io/orders/42",
"data": {
"properties": {
"orderNumber": 42,
"itemCount": 3,
"status": "pending"
},
"links": [
{ "rel": [ "profile" ], "href": "/profiles/order" },
$a = new Thing (a, b);
$cccc = new OtherThing (x, y, z);
$ddddd = new AnotherThing(m);
// John's code
$array = [
'fuwhefuiwe' => new Thing(wefuhwe, wefiuwehfuw, json_encode(weifuhwe)),
'uiwefhiwe' => new Thing(weuifhwegtrtrhrth, weoifwe, json_encode(weiufwe)),
'fuw' => new Thing(ef, gfe, json_encode(regfre)),
'fuwhefuiwe' => new Thing(wefuhwe, wefiuwehfuw, son_encode(weifuhwe)),
'uiwefhiwe' => new Thing(weuifdsfghwe, weoifwe, json_encode(weiufwe)),
'fuw' => new Thing(ef, gfe, json_encode(regfre)),
'fuwhefuiwe' => new Thing(wefuhwe, wefiuwehfuw, json_encode(weifuhwe)),
'uiwefhiwe' => new Thing(weuidfgfhwe, weoifwe, json_encode(weiufwe)),
,
,-. _,---._ __ / \
/ ) .-' `./ / \
( ( ,' `/ /|
\ `-" \'\ / |
`. , \ \ / |
/`. ,'-`----Y |
( ; | '
| ,-. ,-' | /
| | ( | | /
@sbward
sbward / Error.php
Last active December 15, 2015 00:29
<?php
namespace MyApplication\Controller;
use Hydrogen\Controller;
use Hydrogen\MultiTemplateRenderer;
class Error extends Controller
{
use MultiTemplateRenderer;