Skip to content

Instantly share code, notes, and snippets.

View marlalain's full-sized avatar
🫖
HTTP 418

Marla Lain marlalain

🫖
HTTP 418
View GitHub Profile
@marlalain
marlalain / sum.ts
Last active October 23, 2022 20:44
enterprise sum
// @ts-ignore
class NumberValidator {
number: number | undefined;
log = new Logger('NumberValidator');
constructor(n: any) {
this.log.log(`NumberValidator constructor called with ${n}`);
if (typeof n === 'string') {
this.log.error(`NumberValidator failed with string ${n}`);
@faermanj
faermanj / README.md
Last active July 12, 2023 14:12
TDC 2022 - Aplicacoes Seguras com Quarkus

Aplicações Seguras com Quarkus e Keycloak

Julio @faermanj
https://faermanj.me
https://caravana.cluoud
https://gist.github.com/faermanj/270a8a8ab817f95fc2e350ec2d481bd2

Agenda

Aplicação estilo "microserviços" ("PetCare")

@dims
dims / README.md
Last active June 10, 2024 05:14
Kubernetes Resources
@IamFaizanKhalid
IamFaizanKhalid / git-commit-author.md
Last active June 30, 2024 09:47
Change author information of previous commits.

Interactive rebase off of a point earlier in the history than the commit you need to modify (git rebase -i <earliercommit>). In the list of commits being rebased, change the text from pick to edit next to the hash of the one you want to modify. Then when git prompts you to change the commit, use this:

git commit --amend --reset-author --no-edit

For example, if your commit history is A-B-C-D-E-F with F as HEAD, and you want to change the author of C and D, then you would...

  1. Update author's info git config --global user.email example@email.com
  2. Specify git rebase -i B (here is an example of what you will see after executing the git rebase -i B command)
@marlalain
marlalain / ygif.py
Last active December 21, 2023 18:42
Youtube to GIF [Python]
# Youtube to GIF Converter
# (with youtube-dl and ffmpeg)
# made by Paulo Elienay II
# at paulo [at] pauloelienay.com
# imports
import sys, os
# vars
# default vars
@joshschmelzle
joshschmelzle / remap-capslock-to-control-win10.md
Last active May 13, 2024 01:55
Remap Caps Lock to Control on Windows 10

Ways to remap caps lock to control on Windows 10

These methods in this gist worked for me on my U.S.-based keyboard layouts. I am unsure about other layouts. If you have problems, revert your changes; delete the registry key you created (and reboot).

Update: you should probably scroll down to approach 4 where I suggest using Microsoft PowerToys Keyboard Manager.

Approach 1. Manually through regedit

Navigate to and create a new binary value in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout named Scancode Map.

@rtfpessoa
rtfpessoa / handle-ctrl-c.py
Created March 19, 2016 11:28
Handle CTRL+C in Python
#!/usr/bin/env python
import signal
import sys
def signal_handler(signal, frame):
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
@CMCDragonkai
CMCDragonkai / typeofvar.sh
Last active May 19, 2023 01:00
Bash: Get the type of a variable
#!/usr/bin/env bash
typeofvar () {
local type_signature=$(declare -p "$1" 2>/dev/null)
if [[ "$type_signature" =~ "declare --" ]]; then
printf "string"
elif [[ "$type_signature" =~ "declare -a" ]]; then
printf "array"