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 we have a module (here called users.js) that defines actions such as index, show, edit, etc. we pass it as the second parameter for app.resource(). | |
users_resource = app.resource('users', require('./modules/users.js')); | |
//We don't have a module, but we will map functions manually later. Notice we define the base:"/api" here. | |
users_resource = app.resource('others', {base:'/api'}); |
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
# unnest will let me flatten a Hash | |
class Hash | |
def unnest | |
new_hash = {} | |
each do |key,val| | |
if val.is_a?(Hash) | |
new_hash.merge!(val.prefix_keys("#{key}.")) | |
else | |
new_hash[key] = val | |
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
source 'https://rubygems.org' | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '4.0.3' | |
# Use mysql as the database for Active Record | |
gem 'mysql2' | |
# Use SCSS for stylesheets | |
gem 'sass-rails', '~> 4.0.0' |
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
GIT | |
remote: git://github.com/gregbell/active_admin.git | |
revision: 66de2f86ae1d541adf79ca95c3e97c74d9d9c9da | |
specs: | |
activeadmin (1.0.0.pre) | |
arbre (~> 1.0) | |
bourbon | |
coffee-rails | |
devise (~> 3.2) | |
formtastic (~> 2.3.0.rc2) |

Te llaman por teléfono y te avisan que viene aterrizando Bob Dylan de sorpresa en tu país. Quiere dar un concierto pero no está dispuesto a usar una ticketera existente, quiere que tú construyas una ticketera para usar en el resto de su gira con sus amigos artistas. Pero solo tienes 1 hora y media hasta que llegue Bob!
Luego de preguntar, averiguas lo siguiente:
- Bob piensa administrar la ticketera personalmente, y él puede usar la consola de Rails.
- Un evento puede tener más de un artista.
- Un evento tiene un nombre.
- Cada evento tiene una fecha y hora.
- Cada evento tiene n tickets asociados, todos con el mismo precio en dólares.
Verifying that "agustinf.id" is my Blockstack ID. https://onename.com/agustinf
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 'csv' | |
include PersonCsvHelper | |
class DeletePeopleUsingCsv < PowerTypes::Command.new(:file_path) | |
def perform | |
for_each_row do |row| | |
Rails.logger.info("doing the thing") | |
next unless row[:email] | |
person = Person.find_by(email: row[:email]) |
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 "base64" | |
require "digest" | |
require "net/http" | |
require "uri" | |
require "JSON" | |
PRIVATE = ARGV[1] | |
PUBLIC = ARGV[2] | |
def gen_nonce | |
# Sleeps 200ms to avoid flooding the server with requests. |
OlderNewer