Skip to content

Instantly share code, notes, and snippets.

View davidrios's full-sized avatar

David Rios davidrios

  • São Paulo, Brazil
View GitHub Profile
3
00:00:34,000 --> 00:00:37,000
E aí, pessoal, bem-vindos de volta.
4
00:00:37,000 --> 00:00:42,390
O que você acabou de assistir foi uma simulação em tempo real de um motor de combustão interna
5
00:00:42,390 --> 00:00:44,000
@davidrios
davidrios / setup-firefox-flash-linux.sh
Last active January 29, 2021 01:51
Download and configure an old version of Firefox and Flash using a different profile, so you can access old Flash content isolated from your main profile.
#!/bin/bash
FIREFOX_PATH="$HOME/.local/opt/firefox84"
FIREFOX_PROFILE="$HOME/.mozilla/firefox/flash-profile"
[ ! -f "$FIREFOX_PATH/firefox/firefox-bin" ] && (
echo "Downloading Firefox 84"
mkdir -p "$FIREFOX_PATH"
curl -L 'https://ftp.mozilla.org/pub/firefox/releases/84.0.2/linux-x86_64/en-US/firefox-84.0.2.tar.bz2' | tar xj -C "$FIREFOX_PATH"
)
@davidrios
davidrios / factorio-science-blueprints.md
Last active July 24, 2022 19:59
Factorio science pack blueprints

Factorio science pack blueprints

These are compact blueprints to produce 36/m of each science pack (excluding space packs).

36/m of each of the first six science packs is aproximately what a single iron ore mine of aprox. 6m is capable of sustaining.

Automation (red):

preview

Introduction

This page is intended to help you set up a more functional sway desktop environment. Features that will be covered:

  • Manual and automatic screen locking using swayidle and swaylock
  • Working notifications with mako.
  • Nice application launcher and exit menu using fzf and kitty
  • Taking of screenshots, optionally selecting a region, using grim and slurp
  • Volume control with multimedia keys
  • Laptop screen brightness adjustment using brightnessctl and bound to keyboard keys
--- igraph-0.7.1/src/f2c/arithchk.c
+++ igraph-0.7.1-patched/src/f2c/arithchk.c
@@ -110,8 +110,19 @@
return 0;
}
-char *emptyfmt = ""; /* avoid possible warning message with printf("") */
+/* avoid possible warning message with printf("") */
+const char *const emptyfmt = "";
#!/bin/bash
set -e
if [ $(id -u) -eq 0 ]; then
echo 'Please execute this script as a regular user.'
exit 1
fi
which sudo >/dev/null
if [ $? -ne 0 ]; then
#!/bin/bash
NAME=$(/usr/local/bin/find-desktop-apps | fzf -d: --with-nth 2 | cut -d: -f1)
[ -z "$NAME" ] && exit
swaymsg exec "gtk-launch $NAME"
#!/bin/env python3
import logging
import json
import sys
from configparser import RawConfigParser, NoOptionError
from itertools import chain
from locale import getlocale
from pathlib import Path
log = logging.getLogger(__name__)
#!/bin/bash
RESP=$(cat <<EOF | fzf
Logout
Sleep
Reboot
Shutdown
EOF
);
#!/usr/bin/env python3
import json
import sqlite3
from http.server import HTTPServer, BaseHTTPRequestHandler
conn = sqlite3.connect('requests.db')
cur = conn.cursor()
cur.execute('''CREATE TABLE IF NOT EXISTS requests (id integer primary key, datetime text, method text, headers text, body blob)''')