Skip to content

Instantly share code, notes, and snippets.

View rogeruiz's full-sized avatar

Roger Steve Ruiz rogeruiz

View GitHub Profile
@rogeruiz
rogeruiz / Ember.OldieLocation.js.coffee
Last active August 29, 2015 13:57
Oldie Location. Some old fashion HREF wrangling. Seriously, just a simple page refresh.
# For more information see: http://emberjs.com/guides/routing/
Vidz.Router.reopen
location: if Modernizr.history then 'history' else 'oldie'
# IE Ember.Location
# This new location type handles browser support for browsers without support
# for the History API. The Rails app can properly serve a page so when the History
# API isn't supported the Ember application doesn't bother setting a hash or pushing
# a history state. It simply navigates to that location by modifying the location.href
@rogeruiz
rogeruiz / jshintrc.js
Last active August 29, 2015 13:58
Some sane jshint
{
// JSHint Default Configuration File (as on JSHint website)
// See http://jshint.com/docs/ for more details
"maxerr" : 50, // {int} Maximum error before stopping
// Enforcing
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
{{#each fruits}}
{{this}}
{{/each}}
{{draggable-list values=fruits}}
@rogeruiz
rogeruiz / api.js
Created June 21, 2014 18:19 — forked from fwielstra/api.js
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0-rc.3/handlebars.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ember.js/1.0.0-rc.3/ember.js"></script>
<script src="//maps.googleapis.com/maps/api/js?sensor=false"></script>
</head>
<body>
<script>
@rogeruiz
rogeruiz / SupportsAnimationMixin.js
Created July 8, 2014 11:48
Supports Animating Ember Mixin for use with gigafied's ember-animate
;(function ($, Em, global, undefined) {
var App = global.App;
var rAF = global.Modernizr.prefixed('requestAnimationFrame', window) || function (cb) {
global.setTimeout(cb, 1000 / 60);
};
App.SupportsAnimationMixin = Em.Mixin.create({
classNames: ['supports-animation'],
@rogeruiz
rogeruiz / rAFader.js
Last active August 29, 2015 14:03
Simple fade rAF code, tweaked from MDN documentation
window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
var start = null;
var d = $('.js-fader');
// Prep the element for animation
d.css('opacity', 0);
@rogeruiz
rogeruiz / social.js.coffee
Created August 4, 2014 21:52
EmberJS Social Initializer for Controllers [Sketch]
Social = Em.Object.extend
title: null
url: null
image: null
description: null
facebook: (->
endpoint = 'https://www.facebook.com/dialog/feed?'
return endpoint + Em.$.param
app_id: Vidz.get('facebookAppId')
display: 'popup'
@rogeruiz
rogeruiz / breakpoints.scss
Last active August 29, 2015 14:08
MediaQuery with Breakpoint Support & Grid helpers
// Breakpoints relative to the site design
$list-bp:
'small',
'small-2',
'medium',
'large',
'large-2',
'large-3';
$watch-page-height: 72px + 82px + 10px;
@rogeruiz
rogeruiz / sync-sandbox.sh
Last active August 29, 2015 14:09
Proof of concept; a feature branch merge and deploy strategy
#!/bin/bash
# Simple script for rebasing your work on top of the sandbox/auth branch.
# This script and process is a work-in-progress and won't solve all problems well
# or even at all. If there are any issues with this script, please update it as you
# see fit. Thanks for playing...
# ./sync-sandbox.sh ~/Developer/vidz charlie/auth
REPO_DIR=$1
REPO_BRANCH=$2