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 the request is for a static resource, nginx should serve it directly | |
location ~ ^/(images|javascripts|stylesheets|system|assets|jwplayer)/* { | |
root /var/www/www.example.com/current/public; | |
add_header Last-Modified ""; | |
add_header ETag ""; | |
expires max; | |
break; | |
} |
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 ExampleController < ActionController::Base | |
def create | |
Example.create(sanitized_params) | |
end | |
def update | |
Example.find(params[:id]).update_attributes!(sanitized_params) | |
end | |
protected |
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
# gem install taglib-ruby | |
# http://robinst.github.io/taglib-ruby/ | |
require 'taglib' | |
require 'fileutils' | |
module Musix | |
def self.extract(dir, tag_name) | |
Dir.foreach(dir) do |x| | |
file = (dir.split("").last=="/" ? dir : dir+"/") + x | |
if !File.directory?(file) && file.match(/.mp3$/) | |
TagLib::FileRef.open(file) do |fr| |
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
<% flash.each do |type, message| %> | |
<div class="alert <%= bootstrap_class_for(type) %> fade in"> | |
<button class="close" data-dismiss="alert">×</button> | |
<%= message %> | |
</div> | |
<% end %> |