Skip to content

Instantly share code, notes, and snippets.

View justinpeterman's full-sized avatar

Justin Peterman justinpeterman

  • San Francisco, CA
View GitHub Profile
This gist demonstrates share-view composability
@justinpeterman
justinpeterman / sort.js
Created January 24, 2012 07:09
sort an array of objects based on a particular obj property
function compare(a,b) {
if (a.PARAM1 < b.PARAM2)
return -1;
if (a.PARAM1 > b.PARAM2)
return 1;
return 0;
}
ARRAY_OBJECTS.sort(compare);
@justinpeterman
justinpeterman / style.css
Created January 2, 2012 22:40
ios media queries
@media screen and (max-width: 1024px) /*iPad Landscpae*/ {
// CSS styles
}
@media screen and (max-width: 770px) /*iPad Portrait */ {
// CSS styles
}
@media screen and (max-width: 480px) /*iPhone Landscape */ {
// CSS styles
{
"app": "BMW App",
"cards":[
{
"card": "landingCard",
"title": "BMW",
"elements": [
{
@justinpeterman
justinpeterman / app.js
Created November 2, 2011 03:30
select events
new joContainer([
new joLandingImg(landingTiles).selectEvent.subscribe(function (id, list) {
var card = joCache.get("videoCard");
card.setVidMeta(list.getNodeData(id));
App.stack.push(card);
})
])
new joContainer([
tabContent = new joContainer([
new joTitle("Hello from tab1").setStyle({
display: 'none'
}), new joTitle("Hello from tab2").setStyle({
display: 'none'
})]),
new joFlexrow(
@justinpeterman
justinpeterman / style.css
Created October 15, 2011 01:59
animated button
pre {
background: #efefef;
-webkit-box-shadow: 1px 1px 0 #cfcfcf,
2px 2px 0 #cfcfcf,
3px 3px 0 #cfcfcf,
4px 4px 0 #cfcfcf,
5px 5px 0 #cfcfcf;
-webkit-transition: all 0.1s linear;
padding: 20px;
}
@justinpeterman
justinpeterman / app.js
Created October 12, 2011 06:09
Dynamic image in Jo
//init new element
new joHeaderImg("http://scdev.gizmo.com/images/pepsi_faceoff_bold.png","50","50")
<?php
$data="12.30 Conservative Policy Forum
Manchester Central : Exchange Auditorium
CPF Lecture
Open to Party members only
12.30 Demos in partnership with Pears Foundation
Midland Hotel : The French
Best Of British: Reflections on patriotism's place in policy
@justinpeterman
justinpeterman / ad_dialogs.tpl.php
Created September 8, 2011 05:57
global scope variable
<?php
if(!empty($GLOBALS['social_dialog'])): //Step 4: Ok, was anything generated during that pages/element loop?
echo $GLOBALS['social_dialog']; //print out the html string generated if so...
endif;
?>