Skip to content
View Evolution of a Python
#Newbie programmer
def factorial(x):
if x == 0:
return 1
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
View Hash.from_xml
# USAGE: Hash.from_xml(YOUR_XML_STRING)require 'rubygems'
require 'nokogiri'
# modified from
class Hash
class << self
def from_xml(xml_io)
result = Nokogiri::XML(xml_io)
View go_live.html.erb
<!-- go_live.html.erb -->
<title>Go Live!</title>
<meta name="author" content="Luid M Ruiz">
ported to ERB by @SoAwesomeMan
View ox_parsing.rb
require "awesome_print"
module XmlParsing
require "ox"
class Reader < ::Ox::Sax
def initialize file_path, target, target_handler
@target_handler = target_handler
@target = target
@file_path = file_path
View link-to-via-journey-helper-rails.rb
View image_filters.rb
module CarrierWave
module MiniMagick
def toaster_filter
manipulate! do |img|
img.modulate '150,80,100'
img.gamma 1.1
View minimagick-pixel-at-get-hex-color.rb
# get hex color of pixel
# implementation of answer here
# solution to MiniMagick::CommandBuilder error in Rails 3.2.x
# config/application.rb
module AwesomeAppName
class Application < Rails::Application
config.after_initialize do
require Rails.root.join('lib', 'gem_ext.rb')
View image_resizer.rb
require 'mini_magick'
class ImageResizer
attr_accessor :height, :width, :padding, :stretch, :grayscale
def initialize(path)
@image =
View favicons-touch-icons-tiles-2014.html
# This is the answer to my stackoverflow question posted here:
# (I could not get this posted before it got down-voted and closed)
<!-- Favicon (standard)-->
# Favicon and Apple Touch Icon Generator
# This bash script takes an image as a parameter, and uses ImageMagick to convert it to several
# other formats used on modern websites. The following copies are generated:
# * apple-touch-icon-114x114-precomposed.png
# * apple-touch-icon-57x57-precomposed.png
# * apple-touch-icon-72x72-precomposed.png
Something went wrong with that request. Please try again.