Skip to content

Instantly share code, notes, and snippets.

@StephanTLavavej
StephanTLavavej / videos.md
Last active April 30, 2025 12:43
C++ Videos by Stephan T. Lavavej

C9 Lectures

BoostCon (now known as C++Now)

  • 2009: I am not aware of recordings for my talks "C++0x Support in Visual Studio 2010" and "The Parallel Patterns Library in Visual Studio 2010". You aren't missing anything, though.
  • 2010: "Data Structure Visualizers in Visual Studio 2010" is irrelevant as the old visualizer machinery has been completely replaced by something much better (and documented).
  • 2012: Regex In C++11 And Boost
@degaart
degaart / zfs_send.sh
Created April 3, 2022 17:43
Send zfs dataset to another server as fast as possible
#!/usr/bin/env bash
set -eou pipefail
SRC_DATASET="${1-}"
DST_HOST="${2-}"
DST_DATASET="${3-}"
MBUFFER_PORT=1024
if [ "$DST_DATASET" = "" ]; then
@jeetelongname
jeetelongname / autostart
Created April 25, 2020 11:33
Herbstluftwm config
#!/bin/bash
# __
# __ _____ ___ / /______
# / / / / _ \/ _ \/ __/ ___/
# / /_/ / __/ __/ /_(__ )
# \__, /\___/\___/\__/____/
# /____/
# _____
# _________ ____ / __(_)___ _
# / ___/ __ \/ __ \/ /_/ / __ `/
@phiresky
phiresky / README.md
Last active April 5, 2023 00:51
guitar synthesizer in 96 characters of C

tiny guitar synth in 96 chars of C

works by starting with a array filled with white noise (from /dev/urandom), then continuously modulating it with a low pass filter of the desired frequency.

this results in a sound pretty similar to a guitar with steel or nylon strings.

@Mister-Meeseeks
Mister-Meeseeks / aptRecurse.sh
Last active August 2, 2024 07:06
Download apt-get packages and recursive dependencies
#!/bin/bash -eu
# Uses apt-get to download packages and all recursive dependencies to an apt
# repository compatible directory.
#
# Usage:
# aptRecurse [-o OUT_DIRECTORY] PACKAGE_NAME [PACKAGE_NAME]...
#
# (Credit to this StackOverflow comment
# https://stackoverflow.com/a/45489718/868777)
@Eng-Fouad
Eng-Fouad / SampleMingw.kt
Created July 9, 2019 22:38
Kotlin Native Win32 GUI Sample
package sample
import kotlinx.cinterop.*
import platform.windows.*
@ExperimentalUnsignedTypes
fun WndProc(hwnd: HWND?, msg: UINT, wParam: WPARAM, lParam: LPARAM) : LRESULT
{
// This switch block differentiates between the message type that could have been received. If you want to
// handle a specific type of message in your application, just define it in this block.
@graffic
graffic / steam.md
Last active February 9, 2025 06:18
Downloading steam games from another computer/faster line

Framing the issue

With almost no bandwith at home, I needed a way to download DOOM that didn't involve blocking the home internet line for two days.

Approach

Using steamcmd you can use any computer to download steam games.

Downloading

  1. Install it
  2. Open it and loging with your username and password: login username password
@alirobe
alirobe / reclaimWindows10.ps1
Last active June 10, 2025 00:59
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
### OR take a look at
### https://github.com/HotCakeX/Harden-Windows-Security
@amontalban
amontalban / gist:a3c50ec095fe875c0865
Created February 25, 2015 19:00
Resize root partition FreeBSD under VirtualBox with ZFS as root
VBoxManage clonehd in.vmdk out.vdi (Convert current VMDK to VDI)
VBoxManage modifyhd box.vdi --resize 15360 (Resize disk to needed size in Kb)
--- Change VMDK disk to the VDI disk using VirtualBox interface ---
gpart recover ada0 (Where ada0 is the harddrive you want to expand)
gpart resize -i 2 ada0 (Where 2 is the partition number you want to expand, you can see this with "gpart show")
zpool set autoexpand=on zroot (Where zroot is the pool you want to expand)
zpool online -e zroot gpt/disk0 gpt/disk0
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active June 17, 2025 06:11
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%'