Skip to content

Instantly share code, notes, and snippets.

View corbanbrook's full-sized avatar

Corban Riley corbanbrook

  • Horizon Blockchain Games
  • Toronto, Canada
  • X @corban
View GitHub Profile
26350 1
28450 1
29950 1
6450 2
4500 5
7550 3
2400 3
37300 1
5300 5
13150 2
[ { freq: 1, time: 26350 },
{ freq: 1, time: 28450 },
{ freq: 1, time: 29950 },
{ freq: 2, time: 6450 },
{ freq: 5, time: 4500 },
{ freq: 3, time: 7550 },
{ freq: 3, time: 2400 },
{ freq: 1, time: 37300 },
{ freq: 5, time: 5300 },
{ freq: 2, time: 13150 },
class PcmagAddDealLinksScript < Mongoid::Migration
def self.up
site = Property::Site.where(uid: "pcmag").first
smartphone = Sys::Platform.where(name: "smartphone").first
app = site.where(platform: smartphone).first
script = Property::Script.create({ app: app,
name: 'deal links',
type: 'js',
source_path: "theme://javascripts/plugins/zdcse.js",
@corbanbrook
corbanbrook / jquery.inlineStyleFilter.js
Created July 24, 2012 16:06
jQuery :inlineStyle selector filter extention
/**
:inlineStyle filter
An inline style selector filter.
Usage: $("div:inlineStyle(display:none)"); // returns any divs with display style set to none
$("div:inlineStyle(width)"); // returns any divs with a width style set
$("div:inlineStyle"); // returns any divs with an inline style set
Written by Corban Brook @corban
type,
isMobile,
isTablet,
isDesktop,
userAgent,
platform,
vendor,
os,
var navItems = _.chain(Pressly.Manifest.sections).select(function(section) {
// Select all the sections which are not shallow and..
return !section.shallow;
}).collect(function(section) {
// Collect assets from these section which includes..
return _(section.assets).detect(function(asset) {
// The first asset it finds that ..
return asset.children && _(asset.children).any(function(child) {
// Has a a child asset with type of image
return child.type === "image";
@corbanbrook
corbanbrook / load.js
Created February 14, 2012 04:34
Ordered function loader with load.next helper and async callback support
var load = (function() {
var loads = [];
var nextIndex = 0;
var _Load = {
run: function() {
this.next();
},
@corbanbrook
corbanbrook / router.js
Created February 14, 2012 03:14
example of load mechanism on deeply chained async functions
// load and process the manifest
load.add("loading manifest", function() { self.manifest = new Pressly.Manifest(load.next); }, true);
load.add("initialize viewport listeners", self.initializeViewportChangeListeners);
load.add("create static section header layer", function() {
// Static section header layer
self.sectionLayer = new Pressly.Paging("#sections", {
resettable: false,
pageClass: "subpage",
@corbanbrook
corbanbrook / loader.js
Created February 14, 2012 02:56
load stepper for async functions
var a = function(callback) { console.log("A"); callback("Hello from A"); };
var b = function(response, callback) { if (!response) { throw "Err: no response"; } console.log("B", response); callback(); };
var c = function(callback) { console.log("C"); callback(); };
var d = function() { console.log("D"); };
var e = function(callback) { console.log("E"); callback(); };
var f = function() { console.log("F"); };
var load = (function() {
var funcs = [];
var index = 0;
@corbanbrook
corbanbrook / index.html
Created February 10, 2012 17:17
manifest
<section class='manifest' data-timestamp='1327433347'>
<nav class='sections'>
<section data-id='cover-section' title='cover-section'>
<header class='news' role='topnav'>
<div class='logo'>
<img alt='Logo' data-action='goto' data-path='#table-of-contents' src='./img/header-logo.png' />
</div>
<div class='button white back' data-action='close'>Back</div>
<div class='button home' data-action='goto' data-path='#table-of-contents'>Home</div>
<div class='button section_nav' data-action='showNav'>News</div>