Skip to content

Instantly share code, notes, and snippets.

@simonw
simonw / recover_source_code.md
Last active May 21, 2024 19:04
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@nirbhabbarat
nirbhabbarat / gitlab-on-minikube-helm3.md
Last active May 21, 2024 19:01
setup gitlab on minikube using helm3

Setup gitlab on minikube using helm3

Start minikube with virtualbox driver

minikube start \
  --driver=virtualbox \
  --cpus 4 \
  --memory 8192

Recomended: 8 CPU and 30 GB RAM (for demo we are going to use minimal setup)

@tkrotoff
tkrotoff / FrontendFrameworksPopularity.md
Last active May 21, 2024 19:00
Front-end frameworks popularity (React, Vue, Angular and Svelte)
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 21, 2024 18:58
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@harold-b
harold-b / bgfx.odin
Created May 21, 2024 18:50
Odin bindings for bgfx
package bgfx
import "base:intrinsics"
import "base:runtime"
import cffi "core:c"
when ODIN_OS == .Linux {
@require foreign import bgfx {
"libs/windows/bgfx.a",
}
@amiorin
amiorin / README.md
Last active May 21, 2024 18:53
How to configure Home Row Mods with KMonad on macOS

Intro

Karabiner and KMonad are great open source software. Don't forget to support the authors and contributors.

If you want to try home row mods on OSX, don't use Karabiner but KMonad. KMonad is harder at the beginning but then it is easier than Karabiner. Creating layers in KMonad is trivial and without drawbacks, while it is impossible in Karabiner without drawbacks.

You need to compile a PR of the project. Install https://github.com/pqrs-org/Karabiner-DriverKit-VirtualHIDDevice/releases/download/v2.1.0/Karabiner-DriverKit-VirtualHIDDevice-2.1.0.pkg

@SkaTeMasTer
SkaTeMasTer / top-25-ssh-commands-tricks
Created January 18, 2017 00:32
25 Best SSH Commands / Tricks
1) Copy ssh keys to user@host to enable password-less ssh logins.
ssh-copy-id user@host
To generate the keys use the command ssh-keygen
2) Start a tunnel from some machine’s port 80 to your local post 2001
ssh -N -L2001:localhost:80 somemachine
@owlscatcher
owlscatcher / wireguard.md
Last active May 21, 2024 18:51
Инструкция по нрастройке своего VPN сервера на облаке DigitalOcean
@bran921007
bran921007 / gist:da54425cb00c20cdb3ea
Created November 21, 2015 21:47
Detectar si el usuario esta activo o inactivo - Idle javascript
<script>
var timeoutID;
function setup() {
this.addEventListener("mousemove", resetTimer, false);
this.addEventListener("mousedown", resetTimer, false);
this.addEventListener("keypress", resetTimer, false);
this.addEventListener("DOMMouseScroll", resetTimer, false);
this.addEventListener("mousewheel", resetTimer, false);
this.addEventListener("touchmove", resetTimer, false);