Skip to content

Instantly share code, notes, and snippets.

View 3den's full-sized avatar

Marcelo Eden 3den

View GitHub Profile
describe "it creates the correct wrapper object", ->
assertCount ({
"count": 25,
"key": "e114644",
"length": 25,
"name": "Heavy Rotation Station"
}, 25 );
@3den
3den / bayes.js
Created October 26, 2013 09:19
bayes network
var Bayes = (function(){
function constructor(positives, negatives) {
this.positives = positives;
this.negatives = negatives || reverse(positives);
}
function compute(probabilities) {
return probabilities.reduce(function(previous, current){
return previous * current;
}, 1);
@3den
3den / gist:6455996
Last active December 22, 2015 09:59
def hashfy(array)
array.size > 1 ? {array.shift => hashfy(array)} : array.shift
end
require "minitest/autorun"
describe "#hashfy" do
it "converts an array to a nested hash" do
hashfy([:animal, :dog]).must_equal({animal: :dog})
hashfy([:animal, :mammal, :dog]).must_equal({animal: {mammal: :dog}})
Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/staging_development/workspace
Performing Post build task...
Match found for : : True
Logical operation result is TRUE
Running script : /home/wbrent/scripts/jenkins/deploy_staging_development.sh
[workspace] $ /bin/sh -xe /tmp/hudson6604474686417610329.sh
+ /home/wbrent/scripts/jenkins/deploy_staging_development.sh
BUNDLER is installing the Ruby gems: bundle install --without test development
Using rake (0.9.2.2)
997edd1657416dc6fb2253087b6d21b1ee1d0c29 Merge tag '20120514_02'
8b063bbe32264ee614e56d792f9e3721cce89010 Merge pull request #1757 from woboinc/ariel/gemfile_compa
0c768459ce10ac3dbb11fe38110c054d594b9a7c Updating compass in Gemfile
fb55afaf9d42edc9f4d8bb06c005ea3975590f5e Update config/settings/web_services.yml
de6897dade777a6bb30f74c892ddb2d81e2c9bba Removing pry-doc since it's causing segfaults
03242e2dc7cfd04abd42f7b426584289bcaacf7e Require spec_helper instead of spec/spec_helper
41b64623a9ec829623693a7368c305d7b6003e82 Adding rvmrc for 1.9.3
4a27414696e2b9c605a4d686702f275ede15581b 2 weeks ago is different than 14 business days
c0432e1f157b7cd938fd5e858f2de2e3910dba3b Remove comments
0b7795951d63717a5eb9c6f6e831856225967db8 Fix error handling in CreditCard model
261fbf815f9807aa8e4bef1f76ad9c753102d3db Merge pull request #1698 from woboinc/chip/rvm
84402991519916d48bfade83deaa2cb2d840a262 Removing pry-doc since it's causing segfaults
1d63f7719619c41901cd585839b346f64a3a0cd1 Require spec_helper instead of spec/spec_helper
85e99dbc051aa3df4ee75ab5244707390487e164 Adding rvmrc for 1.9.3
e2e67616c4c54b359297c7b8d52553ddcae910d3 2 weeks ago is different than 14 business days
ba5dac3e57cad184b64e59b012f82b5206d59c5f Remove comments
faea13aa9498d34d527d5c126908a63577ec0209 Fix error handling in CreditCard model
971085dc5b95f825e517c872ef0e4dae7479c51f Order#days_left should return an int always
f4f71d563f050381b1ca9d08b3f90d977c333ed5 Add american_date gem and revert usages of Time.
5843e923f3a7d44f055e4cb093a16416cca26462 Don't use failing business_days anymore
ruby-1.9.3-p194@rentwb ~/work/rentwb (chip/rvm*) [05:54:10]
eden$ rspec spec
No DRb server is running. Running in local process instead ...
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /Users/eden/Code/ruby/rails/rentwb/config/environment.rb:7)
/Users/eden/.rvm/gems/ruby-1.9.3-p194@rentwb/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- spec/spec_helper (LoadError)
from /Users/eden/.rvm/gems/ruby-1.9.3-p194@rentwb/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/eden/.rvm/gems/ruby-1.9.3-p194@rentwb/gems/activesupport-3.2.3/lib/active_support/dependenc
@3den
3den / gist:2253369
Created March 30, 2012 17:53
specs
All examples were filtered out; ignoring {:focus=>true}
Admin::Orders::CreditCardsController PUT #update
when credit card is valid
should be success
when update fails
should render form
Api::HealthController
GET #index
@3den
3den / gist:2210995
Created March 27, 2012 00:29
Resume
Skills:
* Objective C, Ruby, PHP, JavaScript, HTML5, CSS, jQuery, SQL, Test Driven Development.
Experience:
* Web Developer at Stack Builders
* Web Developer at BUSK
* Mentor of Joomla! Student Outreach Program at Open Source Matters
* Quick Service at Walt Disney World
* Software Engineer at Orygens
* Software Engineer (GSoC) at Google
@3den
3den / application_controller.rb
Created March 22, 2012 15:23
how to overload device settings?
before_filter :config_old_domain
def config_old_domain
return if request.domain == Settings.domain
Devise.setup do |config|
config.omniauth(
:facebook,
Settings.omniauth.old_facebook.app_id,