Skip to content

Instantly share code, notes, and snippets.

View jrthib's full-sized avatar
🎸

Joseph Thibeault jrthib

🎸
View GitHub Profile
/* Instantiate the global sp object; include models & views */
var sp = getSpotifyApi(1);
var auth = sp.require('sp://import/scripts/api/auth');
var permissions = ['user_actions.music'];
var app_id = '126891607432106';
var request_url = 'https://graph.facebook.com/me/music.listens';
auth.authenticateWithFacebook(app_id, permissions, {
onSuccess : function(accessToken, ttl) {
@jrthib
jrthib / functions.php
Created April 24, 2013 18:36
Wordpress custom post type for hero stories
<?php
add_action('init', 'hero_story_init');
function hero_story_init() {
$args = array(
'label' => __('Hero Stories'),
'singular_label' => __('Hero Story'),
'public' => true,
@jrthib
jrthib / hero.php
Created April 24, 2013 18:37
Chunk of HTML code to query and output hero stories from custom post type, with advanced custom field values as well
<div id="hero" class="loading">
<ul class="slides">
<?php query_posts(array(
'post_type' => 'herostory',
'posts_per_page' => '-1'
));
while(have_posts()): the_post();
?>
@jrthib
jrthib / page.php
Last active December 16, 2015 15:18
Wordpress example that retrieves child pages and outputs them
<?php
query_posts(
array(
'showposts' => 20,
'post_parent' => $page_id,
'post_type' => 'page',
'order' => 'ASC'
)
);
@jrthib
jrthib / functions.php
Created May 8, 2013 17:55
Thematic Child Theme Override
<?php
function childtheme_override_index_loop() {
// Count the number of posts so we can insert a widgetized area
$count = 1;
$alt = 0;
while ( have_posts() ) : the_post();
// action hook for insterting content above #post
thematic_abovepost();
@jrthib
jrthib / gist:5545787
Created May 9, 2013 05:47
Sample NodeJS MongoDB model
var mongoose = require('mongoose')
, Schema = mongoose.Schema
, crypto = require('crypto')
/**
* User Schema
*/
var UserSchema = new Schema({
createdAt: { type: Date, default: Date.now, required: true },
@jrthib
jrthib / ParallaxRowStaticHTML.html
Last active December 17, 2015 15:29
Parallax Row Static HTML
<section id="efficiencyIncluded" class="parallax">
<div class="container">
<div class="col span_7">
<h1>Efficiency <span>Included</span></h1>
<p>Advanced technology to connect healthcare providers and drive EFFICIENCY.</p>
<p class="more"><a href="#" class="button">Find Out More</a></p>
</div>
</div>
</section>
@jrthib
jrthib / ParallaxRowMustache.html
Last active December 17, 2015 15:29
Parallax Row Mustache Template
<section id="{{ID}}" class="parallax">
<div class="container">
<div class="col span_7">
<h1>{{&section_title}}</h1>
<p>{{paragraph}}</p>
<p class="more"><a href="{{link_to}}" class="button">{{button}}</a></p>
</div>
</div>
</section>
@jrthib
jrthib / AzureStorage.js
Created June 25, 2013 04:30
NodeJS Photo Upload with Azure Storage
exports.addCarPhoto = function(req, res) {
var userID = req.user._id;
var carsBaseURI = "http://sobrioapp.blob.core.windows.net/cars/";
// setup photo meta data
var type = req.files.photo.type;
var filename = req.params.id + "-" + req.files.photo.name;
var path = req.files.photo.path;
@jrthib
jrthib / gist:5889118
Created June 29, 2013 00:31
Stop execution of code on browser width
$(window).resize(function() {
var w = $(window).width();
if(w > 1024) {
fixDivsHeight();
} else {
// do whatever mobile wants here...
}
});
function fixDivsHeight() {