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 / gist:5727384
Last active December 18, 2015 04:39 — forked from lucianosousa/gist:5726640
var humanize_time = function(time){
return time > 9 ? time : "0"+time;
}
var milliseconds = 17916;
date = new Date(milliseconds);
humanize_time(date.getUTCMinutes()) + ':' + humanize_time(date.getUTCSeconds());
nowadays: 00:17
expected: 00:17
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
@dukex
dukex / dnsmasq.conf
Last active December 20, 2015 06:18
My development server using nginx, passenger and dnsmasq, bye bye localhost:3000
address=/dev/127.0.0.1
listen-address=127.0.0.1
@dukex
dukex / gist:6172505
Last active December 20, 2015 17:59
Debian/Ubuntu nginx
$ sudo apt-get install libpcre3 libpcre3-dev libssl-dev
$ cd /tmp
$ wget http://nginx.org/download/nginx-1.2.9.tar.gz
$ tar xvzf nginx-1.2.9.tar.gz
$ cd nginx-1.2.9$ ./configure --prefix='/opt/nginx' --with-http_ssl_module --with-cc-opt='-Wno-error' --with-http_stub_status_module
$ make && sudo make install
$ sudo wget https://gist.github.com/dukex/5881970/raw/985fbfaf2c0b496bd4ad28896c41008fa334e979/nginx -O /etc/init.d/nginx
$ chmod +x /etc/init.d/nginx
$ sudo service nginx start
var casper = require("casper").create(),
viewportSizes = [
[320,480],
[320,568],
[600,1024],
[1024,768],
[1280,800],
[1440,900]
],
url = casper.cli.args[0],
@dukex
dukex / find.sh
Created December 3, 2013 01:13
#!/bin/bash
n=0
cat $1 | while read line; do
n=`expr $n + 1`
if [[ $line == *"$2"* ]] ; then
echo "LINHA $n: $line"
fi
done
var removeSugestions = function(){
var x = document.querySelectorAll(".ego_x")
for(var i = 0; i < x.length; i++){
x[i].click()
}
var e = document.querySelectorAll("[name=xout_reason][value=not_interested]")
for(var j = 0; j< e.length; j++){
e[j].click()
}
package xpto
import (
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"strings"
"testing"
### Keybase proof
I hereby claim:
* I am dukex on github.
* I am dukex (https://keybase.io/dukex) on keybase.
* I have a public key whose fingerprint is D795 DD77 98F1 2DD8 0C8C B000 C326 7706 5124 BF2B
To claim this, I am signing this object: