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
| // | |
| // Backbone.Rails.js | |
| // | |
| // Makes Backbone.js play nicely with the default Rails setup, i.e., | |
| // no need to set | |
| // ActiveRecord::Base.include_root_in_json = false | |
| // and build all of your models directly from `params` rather than | |
| // `params[:model]`. | |
| // | |
| // Load this file after backbone.js and before your application JS. |
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
| #!/bin/bash | |
| echo "Automated VPS Setup for Ubuntu 10.04 LTS (Lucid) - Rails with Nginx" | |
| echo "chmod +x stack.sh" | |
| echo "./stack.sh yourdomain.com" | |
| echo "-------------------------------------------------------------------" | |
| echo "Set Hostname" | |
| echo "------------" |
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
| if(!window.Overlay){ | |
| throw new Error('the Class "Overlay" doesn\'t appear to be present'); | |
| } | |
| /* | |
| * Overlay Mask | |
| */ | |
| (function($){ | |
| var Mask = { |
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
| export PATH=/usr/local/bin:/usr/local/sbin:$PATH | |
| [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function | |
| export CLICOLOR=1 | |
| # Colors ---------------------------------------------------------- | |
| export TERM=xterm-color | |
| export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32' | |
| export CLICOLOR=1 |
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
| <!-- layout file --> | |
| <% if current_user %> | |
| Welcome <%= current_user.username %>. Not you? <%= link_to "Log out", logout_path %> | |
| <% else %> | |
| <%= link_to "Sign up", signup_path %> or <%= link_to "log in", login_path %>. | |
| <% end %> |
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/initializers/carrierwave.rb | |
| CarrierWave.configure do |config| | |
| if Rails.env.production? or Rails.env.development? | |
| config.storage :cloud_files | |
| config.cloud_files_username = "your_username" | |
| config.cloud_files_api_key = "your_key" | |
| config.cloud_files_container = "test" | |
| config.cloud_files_cdn_host = "c0012345.cdnn.cloudfiles.rackspacecloud.com" | |
| def store_dir |
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
| // Set up the events for the form | |
| form | |
| .submit(function() { return form.isValid(settings.validators); }) | |
| // added loading toggle to handle the feedback spinner image (and changed 'beforeSend' to just 'before') | |
| .bind('ajax:before', function() { $("#loading").toggle(); return form.isValid(settings.validators); }) | |
| .bind('ajax:success', function() { $("#loading").toggle(); }) | |
| // Callbacks | |
| .bind('form:validate:after', function(eventData) { clientSideValidations.callbacks.form.after( form, eventData); }) | |
| .bind('form:validate:before', function(eventData) { clientSideValidations.callbacks.form.before(form, eventData); }) |
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
| # Colors ---------------------------------------------------------- | |
| export TERM=xterm-color | |
| export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32' | |
| export CLICOLOR=1 | |
| alias ls='ls -G' # OS-X SPECIFIC - the -G command in OS-X is for colors, in Linux it's no groups | |
| #alias ls='ls --color=auto' # For linux, etc |
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 AddAttachmentsDataToWrapper < ActiveRecord::Migration | |
| def self.up | |
| add_column :wrappers, :data_file_name, :string | |
| add_column :wrappers, :data_content_type, :string | |
| add_column :wrappers, :data_file_size, :integer | |
| add_column :wrappers, :data_updated_at, :datetime | |
| end | |
| def self.down | |
| remove_column :wrappers, :data_file_name |
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
| /** | |
| * pocketfm | |
| * Pocket-sized File Manager | |
| * Uses plain html to be as simple as possible | |
| * Code is messy, needs revision and needs | |
| * native mv, rm, cp implementations | |
| * Copyright (c) 2011, Christopher Jeffrey (MIT License) | |
| */ | |
| process.title = 'pocketfm'; |