Skip to content

Instantly share code, notes, and snippets.

View jakebellacera's full-sized avatar

Jake Bellacera jakebellacera

View GitHub Profile
@jakebellacera
jakebellacera / flex_sdk.rb
Last active December 16, 2015 09:58
Flex SDK 4.1 Homebrew Formula
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 April 16, 2013 20:32
Reference movies for iOS

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
@jakebellacera
jakebellacera / jquery.infinitescroll.js
Created March 22, 2013 05:35
Simple infinite scrolling. Down the rabbit hole we go...
(function ($) {
var InfiniteScroll;
InfiniteScroll = function (element, options) {
var self = this,
$window = $(window),
loading = false,
$container = element,
$messageContainer,
@jakebellacera
jakebellacera / gmail-fluidapp-userscript.js
Last active September 16, 2019 17:08
An updated Fluidapp Userscript for Gmail
// use for patterns:
// *gmail.com*
// *mail.google.com*
// *google.com*mail*
window.fluid.dockBadge = '';
setTimeout(updateDockBadge, 3000);
setInterval(updateDockBadge, 15000);
function updateDockBadge() {

Determining which controller/action you're in with Rails 3

By default, you have access to the params object, of which gives you both :controller and :action. Placing this logic into your views can get messy, so I've created some helpers in attempt to DRY things up.

is_matching?, is_controller? and is_action?

is_matching? is a Rails helper method that either compares two objects together.or an object against a scope using constraints such as only and except.

Default usage just aliases the == operator.

Use this shortcut to make your computer faster: ⌥+⇧+⌘+Q

@jakebellacera
jakebellacera / _readme.md
Created November 30, 2012 18:49
CSS code folding for sublime text 2
  1. Tools > New Plugin
  2. Paste code_folding.py
  3. Add key binding at Sublime Text 2 > Preferences > Key Bindings - User
  4. Restart sublime
@jakebellacera
jakebellacera / pom_1.rb
Created November 19, 2012 20:51
Pomade: My First Gem - Code samples
gem 'pomade'
@mixin retina {
@media
only screen and (-moz-min-device-pixel-ratio: 2),
only screen and (-o-min-device-pixel-ratio: 2/1),
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min-device-pixel-ratio: 2) {
@content;
}
}
@jakebellacera
jakebellacera / how-to-install-memcache-on-mamp-2.md
Last active July 4, 2021 16:09
How To Install Memcache on MAMP 2

How To Install Memcache on MAMP 2

Note: This is an old guide and may not work for newer versions of macOS. Please see comments below for additional steps.

  1. Install memcached. I'd suggest using homebrew. brew install memcached
  2. Select your desired version of PHP that you'd like to use in MAMP. This dropdown is located in the PHP tab in MAMP PRO.
  3. Visit the Downloads Page on php.net and download the source code. If your release isn't listed, visit the Releases page.
  4. Extract the source into /Applications/MAMP/bin/php/[php version folder]/include/php.
  5. /Applications/MAMP/bin/php/[php version folder]/include/php/configure
  6. /Applications/MAMP/bin/php/[php version folder]/bin/pecl i memcache.