Skip to content

Instantly share code, notes, and snippets.

View sahensley's full-sized avatar
🐍

Shawn Hensley sahensley

🐍
View GitHub Profile
@eliotsykes
eliotsykes / git-aware-bash-prompt.md
Last active May 30, 2025 08:07
Git Aware Bash Prompt
@pateltej
pateltej / .lua
Created September 30, 2015 00:58
Lua in 15 minutes
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.

Kim's Very Long and Boring Email Text File about File Versioning and Servers.

Hello all.

This is A Very Long and Boring Email Text File about File Versioning and Servers.

Please feel free to point and laugh, but this is all stuff that I've learnt the hard way, and that we should start to do as we get bigger. It doesn't take long for all this to become a habit; something you don't even think about doing. When it's working properly, it offloads a load of organisational stuff from your brain, too - which is nice, and what computers should help you do.

@blueyed
blueyed / xterm-bg.sh
Last active October 11, 2024 03:05
Query background setting from terminal (xterm / rxvt-unicode)
#!/bin/sh
#
# Query a property from the terminal, e.g. background color.
#
# XTerm Operating System Commands
# "ESC ] Ps;Pt ST"
oldstty=$(stty -g)
# What to query?
@mrkline
mrkline / c_sharp_for_python.md
Last active June 2, 2025 14:40
An intro to C# for a Python developer. Made for one of my coworkers.

C# For Python Programmers

Syntax and core concepts

Basic Syntax

  • Single-line comments are started with //. Multi-line comments are started with /* and ended with */.

  • C# uses braces ({ and }) instead of indentation to organize code into blocks. If a block is a single line, the braces can be omitted. For example,

@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active July 4, 2025 11:28
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'