Skip to content

Instantly share code, notes, and snippets.

View mattaebersold's full-sized avatar

Matthew Aebersold mattaebersold

View GitHub Profile
@mattaebersold
mattaebersold / notification
Last active December 16, 2015 04:19
My attempt at creating a scheduled notification in Android
function scheduleNotification(sound, message, hour, min) {
//create a new date, and then set the hours and minutes to what the user has set the alarm to be
var d = new Date();
d.setHours(hour);
d.setMinutes(min);
d.setSeconds(0);
//cancel all existing notifications <><><><><><><><><<><><><><><><><>
clearAllNotifications();
// Generates the modal window when an item is clicked
define(function(require) {
// Dependencies
var $ = require('jquery'),
_ = require('underscore'),
Backbone = require('backbone'),
tram = require('plugins/tram');
// Init view
@mattaebersold
mattaebersold / gist:7406693
Created November 11, 2013 02:14
Example of my JS
define(function(require) {
// Dependencies
var $ = require('jquery'),
_ = require('underscore'),
Backbone = require('backbone'),
app = require('modules/app'),
hammer = require('plugins/jquery-hammer');
// Init view
@mattaebersold
mattaebersold / gist:8425947
Created January 14, 2014 21:20
Interesting way to target links
body.motion-sickness .nav-utility a[href="/motion-sickness"],
body.sponsors .nav-utility a[href="/sponsors"],
body.schedule .nav-utility a[href="/schedule"],
body.schedule .nav-utility a[href="/schedule/friday"],
body.gallery .nav-utility a[href="/gallery"] {
color: $dark-brown;
}
body.lineup .nav-main a[href="/lineup"],
body.trailer .nav-main a[href="/trailer"],
<div class="caption">
<p>This is a description in the slab font</p>
<p class="description">Smaller sub-description. <span class="count">#6 of 24</span></p>
<?php
class GadgetController extends BaseController {
// Default per page
const PER_PAGE = 10;
// Homepage feed
public function index($filter = null) {
// Homepage feed
public function index($filter = null) {
// Tell Laravel where to find the mustache views for post
app('view')->addNamespace('js', public_path().'/js');
// Render the view
$this->layout->nest('content', 'gadget.index', array(
'posts' => Post::filter($filter)->ordered()->visible()->take(self::PER_PAGE)->where('type', '=', 'youtube')->get(),
'filters' => Filter::ordered()->get(),
@mattaebersold
mattaebersold / share-widget
Created April 16, 2014 18:50
share-widget
define(function (require) {
// Dependencies
var $ = require('jquery')
, _ = require('underscore')
, Backbone = require('backbone')
, tram = require('tram')
;
// Setup view
// Return a vimeo embed
public function marqueeVideoEmbed() {
return '<iframe>' . $this->marquee_embed_uid . '</iframe>';
}
.featured-content
%h3 Featured Content
-if($article1 = $flavor->relatedArticle1()->first())
.featured.first
%img(src="#{$article1->croppa(240)}")
%span =$article1->title
-if($article2 = $flavor->relatedArticle2()->first())
.featured
%img(src="#{$article2->croppa(240)}")
%span =$article2->title