Skip to content

Instantly share code, notes, and snippets.

View alexshk's full-sized avatar
🙊
Forking from home

Alex S. alexshk

🙊
Forking from home
  • WB
  • Sydney
View GitHub Profile
@christiannelson
christiannelson / better.rb
Last active September 19, 2018 13:40
Rails Database Best Practices
class Client < ActiveRecord::Base
has_many :projects
scope :active, -> { where(active: true) }
end
class Project < ActiveRecord::Model
belongs_to :client
scope :active, -> {
@clayton
clayton / ffmpeg-install.sh
Created August 9, 2013 18:55
Install FFMPEG on OS X with HomeBrew to convert Mp4 to WebM
# Installation
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid
# Easy Peasy
ffmpeg -i video.mp4 video.webm

This allows you to use the following video streaming services outside of the US from your Mac without having to use a proxy or VPN, so no big bandwidth issues:

  • Hulu / HuluPlus
  • CBS
  • ABC
  • MTV
  • theWB
  • CW TV
  • Crackle
  • NBC
@rojotek
rojotek / DataManager.h
Created April 11, 2012 20:59 — forked from AlexAstroCat/DataManager.h
Core Data singleton manager class capable of being run from a static library - updated for ARC.
// DataManager.h
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
extern NSString * const DataManagerDidSaveNotification;
extern NSString * const DataManagerDidSaveFailedNotification;
@interface DataManager : NSObject {
}
@saetia
saetia / gist:1623487
Last active March 20, 2025 09:04
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@johnrees
johnrees / hamlhtml5boilerplate.html.haml
Created November 15, 2011 10:32 — forked from neiled/hamlhtml5boilerplate.html.haml
Rails 3.1.1 barebones HAML HTML5Boilerplate
!!!
/[if lt IE 7] <html class="no-js ie6 oldie" lang="en">
/[if IE 7] <html class="no-js ie7 oldie" lang="en">
/[if IE 8] <html class="no-js ie8 oldie" lang="en">
<!--[if (gt IE 8)]><html lang="en" class="no-js"><![endif]-->
%head
%meta{charset: "utf-8"}
%meta{:content => "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible"}
%title 'Rails 3.1.1 barebones HTML5Boilerplate'
@jpantuso
jpantuso / osx_lion_rail_setup.md
Created July 27, 2011 19:51
Setup OS X 10.7 w/ homebrew, oh-my-zsh, rvm, rails, and MySQL
@viola
viola / gist:1070410
Created July 7, 2011 20:00
Example of fetching Hash (key,value) to the simple_form collection.
-- model
some sort of constant hash:
HASH_NAME = {
0 => "Choose:",
1 => "On-Campus Recruiting - CSO",·
2 => "CSO Staff Referral",
3 => "Faculty Contact",·
4 => "Career Day",·
5 => "CSO Summer Job Listing",·
6 => "Alumni Contact",·
@rmoriz
rmoriz / Gemfile
Last active September 23, 2024 03:00
UUID primary keys in Rails 3
# Gemfile
gem 'uuidtools'
@AlexAstroCat
AlexAstroCat / DataManager.h
Created April 15, 2011 21:15
Core Data singleton manager class capable of being run from a static library
// DataManager.h
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
extern NSString * const DataManagerDidSaveNotification;
extern NSString * const DataManagerDidSaveFailedNotification;
@interface DataManager : NSObject {
}