Skip to content

Instantly share code, notes, and snippets.

View Graeme22's full-sized avatar
🐍
Building a better Redis client for Python πŸ‘€

Graeme Holliday Graeme22

🐍
Building a better Redis client for Python πŸ‘€
View GitHub Profile
@longtimeago
longtimeago / squash-commits.md
Last active April 1, 2024 20:44
How to squash commits in a GitHub pull request

How to squash commits in a GitHub pull request

o you've contributed some code to an open source project, say, Rails. And they'd like you to squash all of the commits in your pull request. But you're not a git wizard; how do you make this happen?

Normally, you'd do something like this. I'm assuming upstream is a git remote that is pointing at the official project repository, and that your changes are in your 'omgpull' branch:

@idealwebsolutions
idealwebsolutions / ps.sh
Last active September 16, 2024 02:40
Price spot endpoints for ETH and BTC using Coinbase API v2 (no auth required)
# Endpoints for Coinbase API
curl -s https://api.coinbase.com/v2/prices/eth-usd/spot -H 'CB-VERSION: 2015-04-08' | jq -r ".data.amount" | sed -E 's/(.+)/$\1/'
curl -s https://api.coinbase.com/v2/prices/btc-usd/spot -H 'CB-VERSION: 2015-04-08' | jq -r ".data.amount" | sed -E 's/(.+)/$\1/'
# Endpoints for Gemini Ticker API
curl -s https://api.gemini.com/v1/pubticker/ethusd | jq -r 'select(.ask != null)' | sed -E 's/(.+)/$\1/'
curl -s https://api.gemini.com/v1/pubticker/btcusd | jq -r 'select(.ask != null)' | sed -E 's/(.+)/$\1/'
@madaidan
madaidan / Grsecurity overview.md
Last active November 4, 2022 00:59
Overview of Grsecurity/PaX security features and their implementations in mainline and linux-hardened

All logging, compatibility and access control (RBAC) features are excluded.

Implemented in mainline:

  • GRKERNSEC_IO - CONFIG_SECURITY_LOCKDOWN_LSM
  • GRKERNSEC_KMEM - CONFIG_SECURITY_LOCKDOWN_LSM
  • GRKERNSEC_BPF_HARDEN - kernel.bpf_jit_harden
  • GRKERNSEC_KSTACKOVERFLOW - CONFIG_VMAP_STACK
  • GRKERNSEC_HIDESYM - kernel.kptr_restrict
  • GRKERNSEC_RANDSTRUCT - CONFIG_GCC_PLUGIN_RANDSTRUCT
@inactivist
inactivist / README.md
Last active December 22, 2024 19:42
Create an arq RedisSettings instance from a redis: URI (for example, as used in dokku or similar scenarios)
@krcm0209
krcm0209 / README.md
Last active September 16, 2025 04:21
Using AdGuard DNS over HTTPS (DoH) on Windows 11

Why

You may want to use AdGuard's DNS over HTTPS[^2] service if you

  1. Want to make it harder for your ISP to know what websites you are requesting
  2. Want to block most traditional ads from your web browsing experience across your entire PC

Setup instructions

  1. Open PowerShell
@tommyip
tommyip / venv.fish
Last active September 8, 2025 17:06
venv.fish - Automatically activate/deactivate virtualenv in fish shell
# Based on https://gist.github.com/bastibe/c0950e463ffdfdfada7adf149ae77c6f
# Changes:
# * Instead of overriding cd, we detect directory change. This allows the script to work
# for other means of cd, such as z.
# * Update syntax to work with new versions of fish.
# * Handle virtualenvs that are not located in the root of a git directory.
function __auto_source_venv --on-variable PWD --description "Activate/Deactivate virtualenv on directory change"
status --is-command-substitution; and return