This file contains hidden or 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/zsh | |
screenlogs_dir=$HOME/Documents/ScreenLogs/$(date "+%Y-%m-%d") | |
[ ! -d $screenlogs_dir ] && mkdir -p $screenlogs_dir | |
screen_file=$screenlogs_dir/$(date "+%H-%M").png | |
/usr/sbin/screencapture -xm $screen_file | |
# Add to crontab: | |
# crontab -e | |
# */30 * * * * /Users/roma/Documents/ScreenLogs/capture.sh |
This file contains hidden or 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/zsh | |
# Sys tools | |
brew install coreutils cmake git gawk | |
brew install vim zsh starship zplug | |
brew install bat ranger direnv fzf exa fd ripgrep | |
brew install htop glances gotop | |
# Dev langs | |
brew install golang rust python node |
This file contains hidden or 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
from python:3.8-alpine | |
run apk update && apk add zsh | |
run pip install ricksay lolcat | |
shell ["/bin/zsh", "-c"] | |
env N=10 text="Rick{i}: Urghk, you Leo? It's Rick from Dimension#{i} (the best one btw).\ | |
Congrats on leaving a vagina few decades ago, and all this stuff. \ | |
I've seen your adventures, but they suck, mine are interdimensional! \ | |
But I got you a present ... Here we go..." |
This file contains hidden or 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
def myapp(environ, start_response): | |
start_response('200 OK', [('Content-Type', 'text/plain')]) | |
return ['Hello World!\n'] | |
if __name__ == '__main__': | |
from flup.server.fcgi import WSGIServer | |
WSGIServer(myapp).run() |
This file contains hidden or 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
import requests | |
from bs4 import BeautifulSoup | |
# Load wikipedia page | |
url = 'https://en.wikipedia.org/wiki/Race_and_ethnicity_in_the_United_States' | |
page = requests.get(url).content | |
# Use lxml parser | |
soup = BeautifulSoup(page,'lxml') |
This file contains hidden or 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
# Admin | |
snippet modadm "ModelAdmin register" b | |
@admin.register(${1:Model}) | |
class $1Admin(admin.ModelAdmin): | |
list_display = ($2,) | |
endsnippet | |
snippet admreg "Model register" b | |
admin.site.register(${1:Model}) |
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/precise64" | |
config.vm.box_check_update = false | |
config.vm.provider "virtualbox" do |vb| | |
vb.memory = 8068 | |
vb.cpus = 4 |
This file contains hidden or 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
import sys | |
import bs4 | |
import requests | |
from urllib.parse import urlparse, urlunparse | |
def find_icon(domain): | |
resp = requests.get("http://{}/".format(domain)) | |
page = bs4.BeautifulSoup(resp.text, 'html.parser') | |
res = "http://{}/favicon.ico".format(domain) | |
icons = [e for e in page.find_all(name='link') if 'icon' in e.attrs.get('rel')] |
This file contains hidden or 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
# Preloading | |
cat requirements.txt | xargs -t -n1 -P9 pip install -q --download ./dist | |
# Installing with parallel native builds | |
pip install --install-option="--jobs=4" --no-index --find-links=./dist -r ./requirements.txt |
This file contains hidden or 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
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': False, | |
'handlers': { | |
'console': { | |
'level': 'INFO', | |
'class': 'logging.StreamHandler', | |
'formatter': 'simple', | |
}, | |
'file-debug': { |
NewerOlder