Skip to content

Instantly share code, notes, and snippets.

Avatar
🏃‍♂️

Aaron Cruz mraaroncruz

🏃‍♂️
View GitHub Profile
@mraaroncruz
mraaroncruz / console.rb
Created Mar 8, 2014
melted client repl setup
View console.rb
#!/usr/bin/env ruby
require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require 'rubygems'
require 'bundler/setup'
require 'melted_client'
@mraaroncruz
mraaroncruz / console.rb
Last active Aug 29, 2015
mlted client repl with setup
View console.rb
#!/usr/bin/env ruby
require 'bundler/setup'
Bundler.require(:default, (ENV['RACK_ENV'] || :development))
require File.expand_path("../../lib/mlted_service_client", __FILE__)
require 'pry'
SERVER = "http://localhost:9090"
block = MltedService::Client::Block.new
@mraaroncruz
mraaroncruz / spam.txt
Last active Aug 29, 2015
more awesome SPAM
View spam.txt
From: wilson.howard36@barid.com
Attention,
I am Mr. Howard Wilson, Director Unit United Nations Inspection Agent in Hartsfield International Airport Atlanta Georgia USA .
During our investigation,I discovered An abandoned shipment through a Diplomat from United Kingdom via Africa under iship
forwarder which was transferred from JF Kennedy Airport to our facility here in Atlanta. When scanned, it revealed an undisclosed
sum of money in a Metal Trunk Box weighing approximately 55kg each. The consignment was abandoned because the Content was not
properly declared by the consignee as (money) rather it was declared as personal effect to avoid diversion by the Shipping Agent
also the Diplomat inability to pay for Non Inspection Fees.
@mraaroncruz
mraaroncruz / gist
Created Mar 10, 2014
Beginning of SOLID refactoring talk
View gist
#!/usr/bin/env ruby
require 'uri'
require 'net/http'
require 'json'
USER = "pferdefleisch"
def get_gists current_page
uri = URI("https://api.github.com/users/#{USER}/gists?page=#{current_page}")
res = Net::HTTP.get_response(uri)
@mraaroncruz
mraaroncruz / vagrant.md
Created Mar 22, 2014
vagrant talk discussion
View vagrant.md

Discussion below in comments

@mraaroncruz
mraaroncruz / z-index.sass
Created May 1, 2014
z-indeces that make more sense
View z-index.sass
.highest-z
z-index: 20000
=highest-z
@extend .highest-z
.high-middle-z
z-index: 15000
=high-middle-z
@extend .high-middle-z
.middle-z
z-index: 10000
@mraaroncruz
mraaroncruz / foo.md
Last active Aug 29, 2015
How to use mlt framework with ruby
View foo.md

So there are 3 possibilities that I see for getting mlt to work with Ruby.

  1. Run melted and build a ruby client for it. I actually partially built one that I would share with you if you are interested
  2. Use FFI and connect directly to “mlt.h.” This is the direction I would have headed in if I was still using mlt.
  3. Compile the Ruby SWIG bindings, fire up pry (pry was instrumental in being to do anything with the mlt bindings for me) and play around. If you are messing around in the repl, you can send arguments of the wrong type to methods and the error generally tells you what kind of argument it wants. With pry you can also ls classes and objects to see the methods available on them (awesome!).

Here are the lines that expose the SWIG API to the C++ API. So the Ruby classes you can use when you require “mlt”. ex. Producer.new
https://github.com/mltframework/mlt/blob/master/src/swig/mlt.i#L34

@mraaroncruz
mraaroncruz / a_foursquare_categories_to_markdown.rb
Last active Aug 29, 2015
list of foursquare categories and ids
View a_foursquare_categories_to_markdown.rb
require 'json'
require 'net/http'
require 'uri'
#### USE ############################################################################
#
# ruby foursquare_categories.rb MYOAUTHTOKEN > foursquare_categories.md
#
# or if you have the markdown utility installed
#
View 1_Summary.md

Summary - all calculations other files below

The BBQ cost 133 EUR and took in 120 EUR. We have a left over case of beer and a few bags of chips which means we pretty much broke even.

For the 4th of July BBQ, I'll offer something special for the burger purchases from the last BBQ, I don't know what yet.

What this all means is that the burger eaters bankrolled the whole thing.

I would like to charge less for the burgers. I would also like to provide beer, water and other beverages.