Skip to content

Instantly share code, notes, and snippets.

View maxcodes's full-sized avatar
🤓
Hire me! hire@maxholzheu.com

Max Holzheu maxcodes

🤓
Hire me! hire@maxholzheu.com
View GitHub Profile
class Activity < PublicActivity::Activity
end
def ask_watson
uri = URI.parse("https://gateway.watsonplatform.net/personality-insights/api")
Net::HTTP.post_form(uri, { "username" => ENV["username"],
"password" => "ENV["password"]",
"body" => "some text",
})
@maxcodes
maxcodes / log
Created April 22, 2015 01:59
On a journey to install Eventmachine
Building native extensions. This could take a while...
ERROR: Error installing eventmachine:
ERROR: Failed to build gem native extension.
/Users/max/.rbenv/versions/1.9.3-p484/bin/ruby extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... yes
checking for ruby/thread.h... no
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
@maxcodes
maxcodes / user_visits_profile.rb
Created April 21, 2015 22:38
Randomly failing tests
require 'rails_helper'
feature "User visits his profile page" do
before(:each) do
@user = create(:user)
login_as @user
visit user_path(@user)
end
scenario "and has following" do
@maxcodes
maxcodes / gist:156036911815a632ae6f
Created February 24, 2015 05:59
How to Learn to Code
Watch this first:
How to teach yourself to code (video)
https://www.youtube.com/watch?v=T0qAjgQFR4c
Let the fun begin:
Dip your toes:
Codecademy.com
* Javascript course
* HTML + CSS course
@maxcodes
maxcodes / NewMapComponent.js
Last active August 29, 2015 14:15
Pentaho NewMapComponent
/**
*
* NewMapComponent
*
* Places markers on a map or represents values as a color code
*
Changelog 2014-02-27 -------------
Support for representing data as a colored shape in a map,
e.g. population of a country using a color map.
def set_description_for_stripe
# A sample string would be "example@email.com: 1. Black Medium Lightning 2. Matte Silver Small Lightning"
str = "#{params[:email]}: " # => "example@email.com "
loop_count = 1
params[:order][:bracelets_attributes].map do |bracelet|
str << "#{loop_count}. " # => "example@email.com 1. "
# getting error in the next line: can't convert Symbol into Integer
str << "#{bracelet[loop_count-1]["color"]} " # => "example@email.com 1. Black "
str << "#{bracelet[loop_count-1]["size"]} " # => "example@email.com 1. Black Medium "
str << "#{bracelet[loop_count-1]["kind"]} " # => "example@email.com 1. Black Medium Lightning"
source 'https://rubygems.org'
# Add email validation
gem 'validates_email_format_of'
# Handle file upload
gem "carrierwave"
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.2'