- Email: [email protected]
- Twitter: @iHiD
- Website or Blog: http://www.ihid.co.uk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=cache "#{current_user.is_admin?}_user_#{@user.id}_#{@user.updated_at}_#{@user.media_files_updated_at}_#{@user.wall_updated_at}" do | |
%h2= @user.name | |
=cache "#{current_user.is_admin?}_user_#{@user.id}_information_#{@user.updated_at}" do | |
=render "users/information" | |
=cache "user_#{@user.id}_media_files_#{@user.media_files_updated_at}" do | |
=render "users/media_files" | |
=cache "user_#{@user.id}_wall_#{@user.wall_updated_at}" do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2><%= @blog_post.title %></h2> | |
<div id="content"><%= sanitize(@blog_post.content, tags: tags %w(b strong i em)) %></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module DataHelper | |
# Expects a nested array such as: | |
# [[1,'Jez','iHiD'], [2,'Bob','<b>xyz</b>']] | |
# | |
# and outputs: | |
# <table> | |
# <tr><td>1</td><td>Jez</td><td>iHiD</td></tr> | |
# <tr><td>2</td><td>Bob</td><td><b>xyz</b></td></tr> | |
# </table> | |
def data_to_table(data) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module DataHelper | |
... | |
output << "<td>#{h cell}</td>" | |
... | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module DataHelper | |
def data_to_table(data) | |
content_tag :table do | |
data.map do |row| | |
content_tag :tr do | |
row.map {|cell| content_tag :td, cell}.reduce(:<<) | |
end | |
end.reduce(:<<) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module DataHelper | |
def data_to_table(data) | |
content_tag :table do | |
rows = data.map do |row| | |
content_tag :tr do | |
cells = row.map do |cell| | |
content_tag :td, cell | |
end | |
safe_join(cells) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.filter_parameters += [:password, :email] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set up a couple of paths | |
lib_directory = "#{Rails.root}/lib/svgs/" | |
assets_directory = "#{Rails.root}/app/assets/images/pages/" | |
pdf_path = "/Users/iHiD/Downloads/SightSound.pdf" | |
(1..18).each do |id| | |
# Setup image specific paths | |
orignal_filename = "#{lib_directory}#{id}.svg" | |
text_filename = "#{assets_directory}#{id}_text.svg" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Take a photo of you, whenever you make a commit | |
# | |
# This is an improved version of Víctor Martínez original post: | |
# http://coderwall.com/p/xlatfq | |
# | |
# Improvements: |