Skip to content

Instantly share code, notes, and snippets.

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

Duke dukex

✔️
Verified Account
View GitHub Profile
/tmp $> nvm install iojs [ ruby-2.2.2p95 ]
######################################################################## 100,0%
WARNING: checksums are currently disabled for io.js
Now using io.js v3.0.0 (npm v2.13.3)
/tmp $> npm install -g node-sass [ ruby-2.2.2p95 ]
/home/duke/.nvm/versions/io.js/v3.0.0/bin/node-sass -> /home/duke/.nvm/versions/io.js/v3.0.0/lib/node_modules/node-sass/bin/node-sass
> node-sass@3.2.0 install /home/duke/.nvm/versions/io.js/v3.0.0/lib/node_modules/node-sass
> node scripts/install.js
@dukex
dukex / admin.js
Created September 4, 2015 21:33
test-duke0
import Ember from 'ember';
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
export default Ember.Route.extend(AuthenticatedRouteMixin, {
session: Ember.inject.service('session')
beforeModel() {
const userType = this.get('session.authenticated.type');
if(userType !== 'admin') {
this.tranistionTo('login')
}
@dukex
dukex / 5.c
Last active September 7, 2015 23:37 — forked from anonymous/5.c
Avaliação 1
#include <stdio.h>
int main(int argc, char const *argv[]) {
int a, b, temp;
scanf("%d", &a);
scanf("%d", &b);
temp = a;
a = b;
b = temp;
printf("\n Agora a=%d e b=%d\n", a, b);
@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 / 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>
@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