Skip to content

Instantly share code, notes, and snippets.

View jforaker's full-sized avatar

Jake Foraker jforaker

View GitHub Profile
@jforaker
jforaker / A react-native android Facebook login setup.md
Last active December 9, 2018 12:45
react-native android Facebook login
@jforaker
jforaker / ParseService.js
Created July 11, 2015 17:39
Sample Parse service
app.factory('ParseService', function ($q) {
var parse = {};
var query = new Parse.Query('Images');
parse.findAll = function () {
var notModerated = query.equalTo('State', undefined);
@jforaker
jforaker / php_localhost
Created September 7, 2014 22:37
Run php server in directory
php -S localhost:8080
@jforaker
jforaker / Utility.js
Last active August 29, 2015 14:05
Switch statement alternative
function getDrink (type) {
var drinks = {
'beer': 'Budwieser',
'pepsi': 'Pepsi',
'lemonade': 'Lemonade',
'default': 'Default item'
};
return 'The drink I chose was ' + (drinks[type] || drinks['default']);
}
@jforaker
jforaker / FeedItemView.js
Last active August 29, 2015 14:05
Sencha Touch swipe to navigate
listeners: {
swipe: {
element: 'element',
fn: function (e) {
var direction = e.direction,
feednav = Ext.ComponentQuery.query('FeederNav')[0];
if (direction == 'right') {
feednav.reset();
@jforaker
jforaker / FeedItemView.js
Created August 13, 2014 18:44
Parse due dates with moment.js
dues: function (expiresdate){
var now = moment(),
due = moment(expiresdate).format("YYYY-MM-DD"),
todayMoment = moment().format("YYYY-MM-DD"),
dueFormatted = moment(expiresdate).format("MMMM Do YYYY"),
tmrw, yest,
dueInfo = {
color: '',
text: ''
};
@jforaker
jforaker / FeedItemView.js
Created August 13, 2014 18:41
Multiple tap events Sencha Touch
tap: {
element: 'element',
delegate: '.app-box, .doc-box, .bubble-holder',
fn: function(e){
var url = e.target.name,
name = e.delegatedTarget.textContent,
divClassName = e.delegatedTarget.className,
appbox = "app-box",
docbox = "doc-box",
@jforaker
jforaker / gist:441c2eaf6ee0be326e96
Created June 20, 2014 14:59
clone_www.rb :: Clone and build - phonegap
#!env ruby
require 'optparse'
require 'yaml'
DESTINATION_DIRECTORY = './www'
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: clone_www.rb [options]"
@jforaker
jforaker / People.js
Created April 23, 2014 15:49
scrollable config
scrollable: {
fps: 'auto',
direction : 'vertical',
directionLock: true,
indicators: false,
momentumEasing: {
momentum: {
acceleration: 30, // how slowly it stops - high # = stops less
friction: 0.7 // stick factor
},
@jforaker
jforaker / FeedItemView.js
Created April 10, 2014 22:21
Multiple tap listeners
listeners: {
tap: {
element: 'element',
delegate: '.app-box, .doc-box, .bubble-holder',
fn: function(e){
var url = e.target.name
, name = e.delegatedTarget.textContent
, divClassName = e.delegatedTarget.className