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
| # >---------------------------------------------------------------------------< | |
| # | |
| # _____ _ _ __ ___ _ | |
| # | __ \ (_) | \ \ / (_) | | | |
| # | |__) |__ _ _| |___\ \ /\ / / _ ______ _ _ __ __| | | |
| # | _ // _` | | / __|\ \/ \/ / | |_ / _` | '__/ _` | | |
| # | | \ \ (_| | | \__ \ \ /\ / | |/ / (_| | | | (_| | | |
| # |_| \_\__,_|_|_|___/ \/ \/ |_/___\__,_|_| \__,_| | |
| # | |
| # This template was generated by RailsWizard, the amazing and awesome Rails |
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
| <%= JST['shared/menu'] %> | |
| <!-- h2 stays for breadcrumbs --> | |
| <h2><a href="#!/shipping_lists">Guías de Ingreso</a> » <a href="#" class="active">Reportes</a></h2> | |
| <div id="main"> | |
| <h3>Guías</h3> | |
| <% if(collection.models.length > 0) { %> | |
| <h3><a href='#!/shipping_lists/new'>Nuevo ingreso</a></h3><ul> |
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 Integer | |
| def problem? | |
| puts "#trollface" | |
| end | |
| end | |
| 1337.problem? |
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 ruby-mp3info | |
| require 'mp3info' | |
| # Formato: # Pista [espacio] Nombre | |
| # Ejemplo de filtros: | |
| # Antes: 05 - Run Run Run - The Velvet Underground.mp3 | |
| # filters = ["- ", " - The Velvet Underground"] | |
| # Después: 05 Run Run Run.mp3 | |
| def prepare(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
| require 'net/http' | |
| require 'uri' | |
| # Here it all starts. Will just run stuff it the user already has the token on DB | |
| def facebook_register | |
| if user_has_secret_token? | |
| @access_token = create_access_token_from_database | |
| run_facebook_stuff(@access_token) | |
| else | |
| redirect_to authorize_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
| require 'fbgraph' | |
| unless current_user.has_token? | |
| client = FBGraph::Client.new(:client_id => API_KEY,:secret_id =>SECRET_KEY) | |
| else | |
| client = FBGraph::Client.new(:client_id => API_KEY,:secret_id =>SECRET_KEY ,:token => current_user.facebook_token) | |
| end | |
| client.selection.me.photos.until(Time.now).since(3.days.ago).limit(10).info! |
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
| <doctype> | |
| <html> | |
| <head> | |
| <title>Una web</title> | |
| </head> | |
| <body> | |
| <h1>Un título</h1> | |
| <p>Un párrafo</p> | |
| <!-- un comentario --> | |
| <div class="important">Un div</div> |
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
| # autoload concerns | |
| module YourApp | |
| class Application < Rails::Application | |
| config.autoload_paths += %W( | |
| #{config.root}/app/controllers/concerns | |
| #{config.root}/app/models/concerns | |
| ) | |
| end | |
| 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
| class SendList < ActiveRecord::Base | |
| belongs_to :destination, :polymorphic => true | |
| belongs_to :store | |
| has_many :send_list_items | |
| has_many :products, :through => :send_list_items | |
| after_initialize :setup_identifier | |
| def total_items |
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 Admin::SendListsController < InheritedResources::Base | |
| layout 'admin' | |
| before_filter :authenticate_user! | |
| respond_to :xml, :json | |
| before_filter :setup_send_list, :only => :new | |
| after_filter :update_stock, :only => [:create,:update] | |
| def new | |
| new!{ |