So Awesome Man awesome

View Hash.from_xml
1 2 3 4 5 6 7 8 9 10
# USAGE: Hash.from_xml(YOUR_XML_STRING)require 'rubygems'
require 'nokogiri'
# modified from http://stackoverflow.com/questions/1230741/convert-a-nokogiri-document-to-a-ruby-hash/1231297#123129
7
 
class Hash
class << self
def from_xml(xml_io)
begin
result = Nokogiri::XML(xml_io)
View go_live.html.erb
1 2 3 4 5 6 7 8 9 10
<!-- go_live.html.erb -->
<html>
<head>
<title>Go Live!</title>
<meta name="author" content="Luid M Ruiz">
<!--
http://codepen.io/luismruiz
http://codepen.io/luismruiz/pen/hvgey
http://cdpn.io/hvgey
ported to ERB by @SoAwesomeMan
View ox_parsing.rb
1 2 3 4 5 6 7 8 9 10
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
1 2 3 4 5 6 7 8 9 10
View image_filters.rb
1 2 3 4 5 6 7 8 9 10
module CarrierWave
module MiniMagick
def toaster_filter
manipulate! do |img|
img.modulate '150,80,100'
img.gamma 1.1
img.contrast
img.contrast
img.contrast
img.contrast
View minimagick-pixel-at-get-hex-color.rb
1 2 3 4 5 6 7 8 9 10
# get hex color of pixel
# implementation of answer here http://stackoverflow.com/a/8894580/1076207
# 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')
end
View image_resizer.rb
1 2 3 4 5 6 7 8 9
require 'mini_magick'
 
class ImageResizer
 
attr_accessor :height, :width, :padding, :stretch, :grayscale
 
def initialize(path)
@image = MiniMagick::Image.open(path)
end
View favicons-touch-icons-tiles-2014.html
1 2 3 4 5 6 7 8 9 10
<!--
# This is the answer to my stackoverflow question posted here:
# http://stackoverflow.com/questions/22824947/what-are-all-the-favicon-html-implementations-as-of-2014-cross-browser-inclusi
# (I could not get this posted before it got down-voted and closed)
-->
 
 
<!-- Favicon (standard)-->
<!--
# https://github.com/audreyr/favicon-cheat-sheet#ico-file
View favicon.sh
1 2 3 4 5 6 7 8 9 10
#!/bin/bash
 
# 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
View touch-icons.html
1 2 3 4 5 6 7 8 9 10
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
<link rel="apple-touch-icon-precomposed" href="apple-touch-icon-precomposed.png">
 
<!-- For the iPad mini and the first- and second-generation iPad on iOS ≤ 6: -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="apple-touch-icon-72x72-precomposed.png">
 
<!-- For the iPad mini and the first- and second-generation iPad on iOS ≥ 7: -->
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="apple-touch-icon-76x76-precomposed.png">
 
<!-- For iPhone with high-resolution Retina display running iOS ≤ 6: -->
Something went wrong with that request. Please try again.