Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env node
var random = require("node-random");
var argv = require('yargs')
.usage('Uso: $0 <número de inteiros> <número inicial> <número final>')
.demand(3)
.argv
var a = argv['_']
random.integers({
number: a[0],
@underr
underr / translate.py
Created August 3, 2016 17:44
tr*psubs
from yandex_translate import YandexTranslate
import os
progresso=0
translate = YandexTranslate('APIKEY')
with open('subs.srt') as f:
content = f.readlines()
tamanho=len(content)
saida = open('out.srt','w')
import requests, json, time, os
subject = 'trains'
r = requests.get('http://8ch.net/b/catalog.json')
j = json.loads(r.text)
def download(url, name, thread):
filepath = './' + str(thread) + '/' + name
if not os.path.exists(filepath):
@underr
underr / image glutton.js
Last active January 1, 2024 14:22
Repost
// ==UserScript==
// @name Eza's Image Glutton
// @namespace https://inkbunny.net/ezalias
// @author Ezalias
// @description Redirects to high-res images on gallery sites, skipping past descriptions and comments
// @license MIT
// @license Public domain / No rights reserved
// @include /^https*://www\.furaffinity\.net/(view|full)/.*/
// @include https://inkbunny.net/submissionview.php*
// @include http://gelbooru.com/*page=post&s=view*
@underr
underr / Makefile
Created July 17, 2015 19:08
rxtools offline launcher
default:
python -m http.server 8009
@underr
underr / 8ch-downloader.py
Created July 16, 2015 05:48
8chan Downloader - Requires the requests module
#!/usr/bin/python3
# Use: ./8ch-downloader.py <thread url>
import requests, os, json, sys
def download(url, name, subject_path):
filepath = subject_path + '/' + name
if not os.path.exists(filepath):
print('Get got: ' + name)
r = requests.get(url, stream=True)
with open(filepath, 'wb') as f:
@underr
underr / lastfm_cover.py
Last active August 29, 2015 14:24
lastfm cover (requires feh and a last.fm API key)
from mpd import MPDClient
from requests import get
from json import loads
import subprocess
client = MPDClient(use_unicode=True)
client.connect("localhost", 6600)
p = False
SIZE = 3 # small: 0; medium: 1; large: 2; extralarge: 3; mega: 4;
@underr
underr / last_mpd.py
Last active August 29, 2015 14:22
Use MPD vs last.fm to get albums you didn't listened to yet
import json, codecs
import rethinkdb as r
from mpd import MPDClient
from collections import OrderedDict
client = MPDClient(use_unicode=True)
client.connect("localhost", 6600)
pre = []
mpd_albums = []
last_albums = []
@underr
underr / trng_4chan.py
Last active August 29, 2015 14:21
TRNG that uses 4chan's /b/ to get a random seed and display a truly random number
import basc_py4chan, random
# WARNING: this part uses pseudo-random numbers before generating the true ones.
board = basc_py4chan.Board('b')
threads = board.get_threads(page=random.randint(0,6))
random_thread = random.choice(threads)
numbers = []
nn = 1
for post in random_thread.posts:
numbers.append(post.comment)
@underr
underr / _config.ho
Last active August 29, 2015 14:20
punkto
zshrc .zshrc
vimrc .vimrc
tmuxconf .tmux.conf