Skip to content

Instantly share code, notes, and snippets.

View amejiarosario's full-sized avatar
🎯
Think big, start small, learn fast!

Adrian Mejia amejiarosario

🎯
Think big, start small, learn fast!
View GitHub Profile
@amejiarosario
amejiarosario / _flash.html.erb
Created April 22, 2012 20:13 — forked from potomak/_flash.html.erb
Rails flash messages using Twitter bootstrap
<% [:notice, :error, :alert].each do |level| %>
<% unless flash[level].blank? %>
<div class="alert-message <%= flash_class(level) %>">
<a class="close" href="#">×</a>
<%= content_tag :p, flash[level] %>
</div>
<% end %>
<% end %>
@amejiarosario
amejiarosario / RDF_basic.rb
Created February 22, 2012 01:44
RDF.rb basics
#=== Real life examples ===
graph = RDF::Graph.new
# read from file
graph = RDF::Graph.load("http://datagraph.org/jhacker/foaf.nt")
# -or- from the web
graph = RDF::Graph.load("http://dbpedia.org/resource/Elvis_Presley")
graph << RDF::RDFa::Reader.open("http://www.bestbuy.com/shop/ipad+xoom+-windows")
graph.each_predicate { |s| puts s.inspect }
@amejiarosario
amejiarosario / .bash_logout
Created July 13, 2011 03:46
.bash_logout
# ~/.bash_logout
/usr/bin/clear
@amejiarosario
amejiarosario / .bashrc
Created July 13, 2011 03:38
unix/linux useful alias and login bash files
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
## User specific aliases and functions
export COLUMNS