This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Video < ActiveRecord::Base | |
| has_many :video_locations | |
| has_many :locations, :through => :video_locations | |
| accepts_nested_attributes_for :locations | |
| has_many :video_people | |
| has_many :people, :through => :video_people | |
| attr_accessible :title, :date, :url | |
| validates_presence_of :title, :date, :url |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Latest Javadoc Redirect | |
| // @match http://docs.oracle.com/javase/*/api/* | |
| // ==/UserScript== | |
| (function() { | |
| var oldVersions = ['1.3', '1.4.2', '1.5.0', '1,5.0', '6']; | |
| var newVersion = '7'; | |
| var url = window.location.toString(); | |
| for (var i = 0; i < oldVersions.length; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package nfstest; | |
| import com.sun.xfile.XFile; | |
| /** | |
| * Using YANFS | |
| * | |
| */ | |
| public class Main { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <body> | |
| <script type="text/javascript" charset="utf-8"> | |
| // CONSOLE log | |
| var foo = {baz: "tubular", goo: "rad"}, bar = "baz"; | |
| console.log("string",1,foo.goo,bar,foo.baz); // string 1 rad baz tubular | |
| console.log(foo) | |
| // CONSOLE Printf | |
| var foo = {baz: "tubular", goo: "rad"}, bar = "baz"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| brew install snappy | |
| CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ant compile-native | |
| chmod 644 build/native/Mac_OS_X-x86_64-64/lib/* | |
| ls -l /usr/local/lib/libsnappy.dylib | |
| ls -l build/native/Mac_OS_X-x86_64-64/lib/libhadoop.dylib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| config.action_controller.asset_host = Proc.new do |source, request| | |
| non_ssl_host = "http://asset#{source.hash % 4}.backpackit.com" | |
| ssl_host = "https://asset1.backpackit.com" | |
| if request.ssl? | |
| case | |
| when source =~ /\.js$/ | |
| ssl_host | |
| when request.headers["USER_AGENT"] =~ /(Safari)/ | |
| non_ssl_host |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Harmony | |
| # Allows accessing config variables from harmony.yml like so: | |
| # Harmony[:domain] => harmonyapp.com | |
| def self.[](key) | |
| unless @config | |
| raw_config = File.read(RAILS_ROOT + "/config/harmony.yml") | |
| @config = YAML.load(raw_config)[RAILS_ENV].symbolize_keys | |
| end | |
| @config[key] | |
| end |
OlderNewer