Skip to content

Instantly share code, notes, and snippets.

Avatar

Jake Bellacera jakebellacera

View GitHub Profile
@jakebellacera
jakebellacera / scripts_list.php
Last active Jan 21, 2016
Scripts List - PHP managed scripts list
View scripts_list.php
<?php
// Default scripts
$script_list = array(
'vendor/jquery.js',
'vendor/bootstrap.js',
'vendor/video.js',
'`videojs.options.flash.swf = "' . get_bloginfo('stylesheet_directory') . '/assets/swf/videojs.swf"',
'global.js'
);
View ebay-search-api-reddit.js
var appName = "yourAppName",
keywords = encodeURI("my search term"),
url = "http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByKeywords&SERVICE-VERSION=1.0.0&SECURITY-APPNAME=" + appName + "&RESPONSE-DATA-FORMAT=XML&REST-PAYLOAD&keywords=" + keywords;
$.get(url, function (response) {
console.log(response);
// response would be the parsed XML body.
// you could then work with this by treating it as an DOM
// node in jQuery. For example:
// response.find('elementName').html()
@jakebellacera
jakebellacera / vine.rb
Last active Dec 2, 2016
vine ruby api
View vine.rb
require "httparty"
require "json"
module Vine
# Public: The unofficial interface for the Vine API. Vine requires all
# requests to be authenticated when accessing the API.
#
# Examples
#
# vine = Vine::API.new("username", "password")
@jakebellacera
jakebellacera / focus
Last active Dec 25, 2015
focus - blacklists certain websites
View focus
#!/bin/bash
################################################################################
# FOCUS
# =====
# Blacklists certain websites.
#
# How to use:
# 1. Edit the DOMAINS variable with the domains you'd like to blacklist
# 2. run `/path/to/focus start` to start focusing
@jakebellacera
jakebellacera / browserstack
Last active Dec 22, 2015
BrowserStack tunnel bash script
View browserstack
#!/bin/bash
# BrowserStack Tunnel bash script
# By: Jake Bellacera (http://jakebellacera.com)
#
# Usage:
# browserstack
# browserstack start [opts=localhost,80,0] # starts a tunnel
TUNNEL_KEY="abcdefg12345"
@jakebellacera
jakebellacera / sass_retinize.rb
Last active Dec 18, 2015
The non-clunky approach to supporting retina images in SASS.
View sass_retinize.rb
module Sass::Script::Functions
# Appends "_2x" to the end of a filename before the extension
# e.g. foobar.jpg => foobar_2x.jpg
def retinize(string)
assert_type string, :String
Sass::Script::String.new string.value.gsub(/\.(\w+)$/, '_2x.\\1')
end
declare :retinize, :args => [:string]
@jakebellacera
jakebellacera / bike-shop.js
Last active Dec 18, 2015
BikeShop - simple AJAX template manager (with caching!) for Handlebars.js. http://jsfiddle.net/jakebellacera/89XER/
View bike-shop.js
// BikeShop
//
// Simple asynchronous template management for Handlebars.js.
//
// By Jake Bellacera (http://jakebellacera.com)
//
// Usage:
// 1. Include Handlebars in your project.
// 2. Include BikeShop in you project.
// 4. Initialize a new BikeShop instance with the path to the templates dir as
@jakebellacera
jakebellacera / crossdomain.xml
Created May 6, 2013
crossdomain.xml example
View crossdomain.xml
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>
@jakebellacera
jakebellacera / flex_sdk.rb
Last active Dec 16, 2015
Flex SDK 4.1 Homebrew Formula
View flex_sdk.rb
require 'formula'
class FlexSdk < Formula
homepage 'http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK'
url 'http://fpdownload.adobe.com/pub/flex/sdk/builds/flex4/flex_sdk_4.1.0.16076A_mpl.zip'
version '4.1.0.16076A'
sha1 '05323a17fc298c5747f0383c3cfc8ad4c62e1965'
def install
libexec.install Dir['*']
@jakebellacera
jakebellacera / _readme.md
Created Apr 16, 2013
Reference movies for iOS
View _readme.md

Reference Movies for iOS & Desktop

Reference movies let you serve up a specific video for a mobile user depending on the type of connection they have. Desktop users will fall back to playing the single desktop video.

Things to know

  • The iPhone will not play videos larger than 480x320 @ 30fps
  • You should only use H.264-encoded videos in order to play on mobile properly
  • "mobile" videos will only work on iPhone/iPod Touch; iPad will play the desktop.mp4
You can’t perform that action at this time.