Skip to content

Instantly share code, notes, and snippets.

View rngtng's full-sized avatar

Tobias Bielohlawek rngtng

View GitHub Profile
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 22, 2024 05:53
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%'
@wadey
wadey / iterm2.zsh
Last active March 10, 2024 00:32
Change iTerm2 tab color when using SSH
# Usage:
# source iterm2.zsh
# iTerm2 tab color commands
# https://iterm2.com/documentation-escape-codes.html
if [[ -n "$ITERM_SESSION_ID" ]]; then
tab-color() {
echo -ne "\033]6;1;bg;red;brightness;$1\a"
echo -ne "\033]6;1;bg;green;brightness;$2\a"
[color]
diff = auto
status = auto
branch = auto
[gui]
recentrepo = /Users/ullrich/Desktop/Arbeit/Projekte/SAPDemo/MacCRO
[alias]
st = status
ci = commit
br = branch
#include "WProgram.h"
void UpdateDMD();
void Bounce();
void SetAllDots(byte value);
void SetDot(byte col, byte row, byte value);
void FrameToSerial();
#define pinDisplayEnable 3 // DMD pin 1
#define pinRowData 4 // One pin 3
#define pinRowClock 5 // DMD pin 5
#define pinColLatch 6 // DMD pin 7
@yagihiro
yagihiro / CircularBuffer.h
Created February 18, 2009 09:50
circular buffer library for Arduino (C++)
/*
CircularBuffer.h - circular buffer library for Arduino.
Copyright (c) 2009 Hiroki Yagita.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to