This file contains 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
<% [: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 %> |
This file contains 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
require 'bundler/setup' | |
require 'mechanize' | |
require 'open-uri' | |
agent = Mechanize.new | |
# agent.set_proxy 'localhost', 3128 | |
# login | |
agent.get('https://www.codeschool.com/users/sign_in') do |page| | |
result = page.form_with(:action => '/users/sign_in') do |form| |
This file contains 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
//l.sauer 2011, public domain | |
//returns a hash table with the word as index and frequency as value; good for svg / canvas -plotting or other experiments | |
//[:punct:] Punctuation symbols . , " ' ? ! ; : # $ % & ( ) * + - / < > = @ [ ] \ ^ _ { } | ~ | |
var wordcnt = function(id){ | |
var hist = {}, words = document.getElementById(id).innerText.split(/[\s*\.*\,\;\+?\#\|:\-\/\\\[\]\(\)\{\}$%&0-9*]/) | |
for(var i in words) | |
if(words[i].length >1 ) | |
hist[words[i]] ? hist[words[i]]+=1 : hist[words[i]]=1; | |
return hist; | |
}; |