Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔

Duke dukex

🤔
View GitHub Profile
@dukex
dukex / string.js
Created Apr 3, 2011
string_spec.js
View string.js
String.prototype.reverse = function(){
return this.split("").reverse().join("");
}
@dukex
dukex / jasmine.js
Created Apr 27, 2011
qUnit Vs Jasmine
View jasmine.js
describe("accessibility", function () {
beforeEach(function(){
var ac = $('#menu1').menu();
var item0 = $("li:eq(0) a");
});
it("should has menu class", function(){
expect(ac.hasClass("ui-menu ui-widget ui-widget-content ui-corner-all")).toEqual(true);
});
View install.sh
open "http://code.google.com/p/iterm2/downloads/list"
open "https://github.com/kennethreitz/osx-gcc-installer"
sudo /Developer/Library/uninstall-devtools –mode=all
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
brew update
brew install git
brew install mysql
@dukex
dukex / hack.sally
Created Mar 29, 2012
First API Proposal to Sally
View hack.sally
My target 'evinicius.com'
I want the links of '#posts' list
Export to 'XML'
@dukex
dukex / hack.rb
Created Mar 29, 2012
New API Proposal to Sally
View hack.rb
Sally.start do
analise do
target "url.com"
data { uf: "SP" }
method "POST" # or GET
end
search_and_extract root: "ul#any_resource li" do # root default is html
data :name, "div a" # like -> ul li div a
data :desc, "#content p" do |p|
p.text # passed the element, in example p
@dukex
dukex / application.js
Created Apr 30, 2012
Example to getmygist
View application.js
console.log("Test console ");
console.log(" Another Test console ");
View reactive_scraper_example.html
<!-- http://reactivescraper.herokuapp.com/test.html -->
<html>
<head>
<title>Test</title>
</head>
<body>
<ul>
<li>
<span class="name"> Jonh </span>
<span class="votes"> 90 </span>
View gist:3043333
// Simple JavaScript Templating
// John Resig - http://ejohn.org/ - MIT Licensed
(function(){
var cache = {};
this.tmpl = function tmpl(str, data){
// Figure out if we're getting a template, or if we need to
// load the template - and be sure to cache the result.
var fn = !/\W/.test(str) ?
cache[str] = cache[str] ||
View projects.md

Projects

Augusta App (out)

This is a personal project, my initial idea was to put in the same website all events happening in Augusta Street (a very famous street because of its underground night clubs and bars in São Paulo). In the first version, I used ruby on rails and jquery mobile. After I splat the project in mobile version and desktop version, I ditched jquery mobile and started to use Backbone.js. The project consisted of web crawlers to watch the night clubs websites and gather the data to populate a database. I made this project solo, from the backend to the design/frontend.

Adote um Pedido

This is a project together with the Transparencia Hacker community. The idea is makes possible the people make a information request to government anonymously. The law of Information access in Brazil need the requester's information. I made this project solo(code part), from the backend to the des

View integration_test.rb
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
require 'machinist/active_record'
require 'machinist/caching/active_record'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
spec_support = Rails.root.join("spec/support/**/*.rb")