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
let table = [...document.querySelectorAll('table[width="550"] > tbody')][1]; | |
let items = [...table.querySelectorAll("tr")].map( | |
tr => [...tr.querySelectorAll("td")].map( | |
td => /good/.test(td.querySelector("img")?.src) || td.innerText || false | |
) | |
).map( | |
it => [it.slice(0, 2), it.slice(3, 5)] | |
) | |
.flat() | |
.filter(it => it.length); |
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
# based on http://uberblo.gs/2011/06/high-performance-url-shortening-with-redis-backed-nginx | |
# using code from http://stackoverflow.com/questions/3554315/lua-base-converter | |
# "database scheme" | |
# database 0: id ~> url | |
# database 1: id ~> hits | |
# database 2: id ~> [{referer|user_agent}] | |
# database 3: id ~> hits (when id is not found) | |
# database 4: id ~> [{referer|user_agent}] (when id is not found) | |
# database 5: key "count" storing the number of shortened urls; the id is generated by (this number + 1) converted to base 62 |
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
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"os" | |
"regexp" | |
"sort" | |
"strconv" | |
"strings" |
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
# take one | |
# subdirectory (one server, multiple services) | |
location /btsync/ { | |
rewrite ^/btsync/gui(.*) /btsync$1 last; | |
proxy_pass http://127.0.0.1:8888/gui/; | |
proxy_redirect /gui/ /btsync/; | |
proxy_buffering off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: btsync | |
# Required-Start: $local_fs $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Should-Start: $network | |
# Should-Stop: $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Multi-user daemonized version of btsync. |
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
/** | |
* Calcula o rendimento de poupança de um valor em um período específico. | |
* | |
* @param {value} input O valor a ser calculado. | |
* @param {initialDate} input Data inicial. | |
* @param {finalDate} input Data final. | |
* @return O valor corrigido. | |
* @customfunction | |
*/ | |
function CORRECAO_POUPANCA(value, initialDate, finalDate = now()) { |
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 "win32ole" | |
count = 100 | |
ttl = 86400 | |
cache_file = "wa.random.cache" | |
query = [ | |
'type = "0"', | |
'length > "2:00"', | |
'title NOTHAS "intro"', |
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
minSpeed=1500 | |
maxSpeed=5500 | |
highTemp=70 | |
normalTemp=40 | |
output=/sys/devices/platform/applesmc.768/fan1_output | |
manual=/sys/devices/platform/applesmc.768/fan1_manual | |
currentSpeed=$(cat $output) |
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
hosts=/etc/hosts | |
host=$1 | |
ip=$2 | |
if [ "$ip" = "" ]; then | |
ip=$(wget -qO- http://checkip.dyndns.org | cut -f2 -d":" | cut -f1 -d"<" | sed "s/ //") | |
fi | |
line=$(grep $host $hosts) |
NewerOlder