Skip to content

Instantly share code, notes, and snippets.

@patsancu
patsancu / login_playwright.py
Last active January 27, 2025 20:07
login to site using playwright #playwright #login #automation
# pip3 install playwright; playwright install
# Notes:
# - should not have to sleep, but it's needed because the `networkidle` is not working well enough
# - using `networkidle`, because it's what chatGPT suggested in its first draft.
# the recommended way would be either "domcontentloaded" or "load", but neither work.
from time import sleep
from playwright.sync_api import sync_playwright
@patsancu
patsancu / git-advanced-shotgun-buffet.sh
Created July 30, 2024 14:22 — forked from v33rh0ra/git-advanced-shotgun-buffet.sh
git-advanced-scott-chacon-fosdem2024
# ---------------------------------------------------------
# Porcelain (82)
# 44 main commands (add, commit, push, pull, ..)
# 11 manipulators (config, reflog, replace, ..)
# 17 interrogators (blame, fsck, rerere, ..)
# interactors (send-email, p4, svn, ..)
# Plumbing (63)
# 19 manipulators (apply, commit-tree, update-ref, ..)
# 21 interrogators (cat-file, for-each-ref, ..)

Paste videos

ffmpeg -f concat -safe 0 -i <(for f in ./*.mp4; do echo "file '$PWD/$f'"; done) -c copy output.mp4

Trim first 7 seconds of video

ffmpeg -i input.mp4 -ss 7 -vcodec copy -acodec copy output.mp4
@patsancu
patsancu / dax.csv
Last active October 16, 2023 14:56
dax companies as of 2023-10-16 #data
Company Name Ticker Symbol
SAP SAP
Siemens SIE.DE
Deutsche Telekom DTE.DE
Airbus AIR.PA
Allianz ALV.DE
Porsche P911.DE
Mercedes-Benz MBG.DE
BMW BMW.DE
Merck KGaA MRK.DE
tmux new-window -c $HOME/code/management-platform/ "a"; tmux split-window -h -d "b"; tmux split-window -d "c"; tmux split-window -d "d"
-c sets working directory
a |
-----|
d | b
-----|
c |
function do-reports() {
tmux new-window "vim TODO_$(date +%Y%m%d).md"; tmux split-window -d "vim DOING_$(date +%Y%m%d).md"
}
@patsancu
patsancu / wordlist-german.txt
Last active August 1, 2024 14:34 — forked from MarvinJWendt/wordlist-german.txt
All german words (german wordlist). #data #dictionary #german #dict #wörterbuch #deutsch
This file has been truncated, but you can view the full file.
AA
AAA
Aachen
Aachener
Aachenerin
Aachenerinnen
Aachenern
Aacheners
Aachens
Aal
@patsancu
patsancu / RAILS_CHEATSHEET.md
Created March 5, 2023 20:12 — forked from mdang/RAILS_CHEATSHEET.md
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

  • Vertigo (1958)
  • Citizen Kane (1941)
  • Tokyo Story (1953)
  • The Rules of the Game (1939)
  • Sunrise: A Song of Two Humans (1927)
  • 2001: A Space Odyssey (1968)
  • The Searchers (1956)
  • Man with a Movie Camera (1929)
  • The Passion of Joan of Arc (1928)
  • 8½ (1963)