Skip to content

Instantly share code, notes, and snippets.

View onlurking's full-sized avatar
:shipit:
ship it

Diogo Felix onlurking

:shipit:
ship it
View GitHub Profile
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
@onlurking
onlurking / kitty.conf
Created July 27, 2018 03:55
$HOME/.config/kitty/kitty.conf
foreground #d3d0c8
background #2d2d2d
background_opacity 0.8
dynamic_background_opacity no
color0 #2d2d2d
color8 #5a5a5a
color1 #f2777a
color9 #f2777a
color2 #99cc99
/*!
* Paper.js v0.11.5 - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
*
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
* http://scratchdisk.com/ & http://jonathanpuckey.com/
*
* Distributed under the MIT license. See LICENSE file for details.
*
* All rights reserved.
from requests import get, utils
from bs4 import BeautifulSoup
from tomd import Tomd
from collections import namedtuple
from execjs import eval, compile
from time import sleep
ctx = compile("""
function markdown(source) {
var TurndownService = require('turndown');
from requests import get
from bs4 import BeautifulSoup
from tomd import Tomd
from collections import namedtuple
def parse_page(url):
html = get(url).content
soup = BeautifulSoup(html, "html5lib")
return soup
from datetime import datetime
from collections import namedtuple
def normalize_date(ct, m = '00', s = '00'):
"""Return formated time_object with hour - 1,
and zero-filled minutes and seconds.
>>> normalize_date(datetime.strptime('Jun 1 2005 1:33PM', '%b %d %Y %I:%M%p'))
Date(year=2005, month=6, day=1, hour=12, minute='00', second='00')
@onlurking
onlurking / albums.md
Created March 30, 2018 22:20
Pitchfork's 1001 Albums You Must Hear Before You Die

Pitchfork's 1001 Albums You Must Hear Before You Die

50's

  • In The Wee Small Hours - Frank Sinatra (1955)
  • Ellington at Newport _56 - Duke Ellington (1956)
  • Elvis Presley - Elvis Presley (1956)
  • Songs For Swingin' Lovers - Frank Sinatra (1956)
  • Birth of the Cool - Miles Davis (1956)
  • Tragic Songs Of Life - The Louvin Brothers (1956)
@onlurking
onlurking / infinite.py
Last active March 6, 2018 17:44
generate all possible strings under 20 lines of Python
from itertools import count, product
from string import digits, ascii_lowercase, ascii_uppercase
from sys import stdout
import argparse
combinations = ascii_lowercase
parser = argparse.ArgumentParser()
parser.add_argument("--digits", "-d", help="include numbers", action="store_true")
parser.add_argument("--upper", "-u", help="include uppercase letters", action="store_true")
args = parser.parse_args()
@onlurking
onlurking / book.py
Last active March 4, 2018 18:14
crawl elder scrolls books and save as markdown (WIP)
from splinter import Browser
from bs4 import BeautifulSoup
import tomd
from html_sanitizer import Sanitizer
# pip install tomd splinter html-sanitizer beautifulsoup4
browser = Browser(
'chrome', user_agent="Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en)")
async function add3(x) {
return new Promise(resolve => {
setTimeout(() => {
resolve(x + 3);
}, 2000);
});
}
async function t3() {
let x;