Skip to content

Instantly share code, notes, and snippets.

@moyix
moyix / killbutmakeitlooklikeanaccident.sh
Created February 5, 2022 22:51
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
type sat_fat polysat_fat monosat_fat protein carb chol fiber kcal
blue 18.669 0.8 7.778 21.4 2.34 75 0 353
brick 18.764 0.784 8.598 23.24 2.79 94 0 371
brie 17.41 0.826 8.013 20.75 0.45 100 0 334
camembert 15.259 0.724 7.023 19.8 0.46 72 0 300
caraway 18.584 0.83 8.275 25.18 3.06 93 0 376
cheddar 21.092 0.942 9.391 24.9 1.28 105 0 403
cheshire 19.475 0.87 8.671 23.37 4.78 103 0 387
colby 20.218 0.953 9.28 23.76 2.57 95 0 394
cottage,crmd,lrg or sml curd 1.718 0.123 0.778 11.12 3.38 17 0 98
@graninas
graninas / What_killed_Haskell_could_kill_Rust.md
Last active March 18, 2024 14:57
What killed Haskell, could kill Rust, too

At the beginning of 2030, I found this essay in my archives. From what I know today, I think it was very insightful at the moment of writing. And I feel it should be published because it can teach us, Rust developers, how to prevent that sad story from happening again.


What killed Haskell, could kill Rust, too

What killed Haskell, could kill Rust, too. Why would I even mention Haskell in this context? Well, Haskell and Rust are deeply related. Not because Rust is Haskell without HKTs. (Some of you know what that means, and the rest of you will wonder for a very long time). Much of the style of Rust is similar in many ways to the style of Haskell. In some sense Rust is a reincarnation of Haskell, with a little bit of C-ish like syntax, a very small amount.

Is Haskell dead?

@7aman
7aman / sqlite3-in-python.py
Created January 21, 2019 07:29
sqlite3 cheatsheet for python 3
#!/usr/bin/env python3
'''
Thanks to Andres Torres
Source: https://www.pythoncentral.io/introduction-to-sqlite-in-python/
'''
import sqlite3
# Create a database in RAM
@fnky
fnky / ANSI.md
Last active April 24, 2024 03:46
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
According to all known laws of aviation, there is no way a bee should be able to fly.
Its wings are too small to get its fat little body off the ground.
The bee, of course, flies anyway because bees don't care what humans think is impossible.
Yellow, black. Yellow, black. Yellow, black. Yellow, black.
Ooh, black and yellow!
Let's shake it up a little.
Barry! Breakfast is ready!
Coming!
Hang on a second.
Hello?
@noelboss
noelboss / git-deployment.md
Last active April 24, 2024 03:17
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@j-po
j-po / gitstack.sh
Last active August 7, 2022 09:55
`pushd` and `popd`-style commands for git branches (in the place of directories)
# `pushd` and `popd`-style commands for git branches (in the place of directories)
# USAGE: `pushb <branch>; SOME_WORK; popb`
GITSTACK=() # stack of branches–just an array that we add to and access from the tail
GITSTASHCK=() # stack of stashes
function pushb {
GITSTACK+=`git symbolic-ref --short HEAD`
GITSTASHCK+=`git stash create`
git reset --hard # `git stash create` doesn't do this the way `git stash` normally does
git checkout $1
@adamblank
adamblank / cheese.json
Created December 6, 2013 20:40
JSON array of every type of cheese.
[
"Abbaye de Belloc",
"Abbaye du Mont des Cats",
"Abertam",
"Abondance",
"Ackawi",
"Acorn",
"Adelost",
"Airag",
"Airedale",