Skip to content

Instantly share code, notes, and snippets.

View dukex's full-sized avatar
✔️
Verified Account

Duke dukex

✔️
Verified Account
View GitHub Profile
@dukex
dukex / string.js
Created April 3, 2011 04:11
string_spec.js
String.prototype.reverse = function(){
return this.split("").reverse().join("");
}
@dukex
dukex / jasmine.js
Created April 27, 2011 23:45
qUnit Vs Jasmine
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);
});
@dukex
dukex / install.sh
Created June 20, 2011 04:29
ambiente
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 March 29, 2012 16:43
First API Proposal to Sally
My target 'evinicius.com'
I want the links of '#posts' list
Export to 'XML'
@dukex
dukex / hack.rb
Created March 29, 2012 16:46
New API Proposal to Sally
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 April 30, 2012 19:16
Example to getmygist
console.log("Test console ");
console.log(" Another Test console ");
@dukex
dukex / reactive_scraper_example.html
Created May 11, 2012 21:58
Reactive Scraper Example
<!-- 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>
// 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] ||
@dukex
dukex / projects.md
Last active October 12, 2015 06:08

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

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")