Verifying that "agustinf.id" is my Blockstack ID. https://onename.com/agustinf
This file contains 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 'JSON' | |
require 'httpparty' | |
HOST = 'https://www.buda.com' | |
def new_order(symbol, amount, type, side, price = nil) | |
side = side == :buy ? 'Bid' : 'Ask' | |
payload = { order: { type: side, price_type: type.to_s, | |
limit: price.to_s, amount: amount.to_s } } | |
path = "/api/v2/markets/#{symbol}/orders" |
This file contains 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. |
This file contains 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]) |
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.

This file contains 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) |
This file contains 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 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 |
NewerOlder