Skip to content

Instantly share code, notes, and snippets.

View zacps's full-sized avatar

Zac Pullar-Strecker zacps

View GitHub Profile
@stephennancekivell
stephennancekivell / pgbench.md
Created August 21, 2023 10:15
pgbench examples

Insert data

insert.sql

\set id random(1, 100000 * :scale)
\set uuid gen_random_uuid()


insert into my_table (id, uuid)
values
@jesskfullwood
jesskfullwood / Cargo.toml
Created August 25, 2018 13:36
Actix-web + futures 0.3 + async example
cargo-features = ["rename-dependency"]
[package]
name = "actix-async"
version = "0.1.0"
[dependencies]
actix-web = "0.7.4"
futures-preview = { version = "0.3.0-alpha.3", features = ["tokio-compat"] }
futures1 = { version = "0.1", package = "futures" }
@MichaelPote
MichaelPote / himawari.ps1
Created February 3, 2016 19:11
Windows Powershell Script to download the latest image from the Himawari-8 satelite, combine the tiles into a single image, convert to jpg and then set as the desktop background.
#
# Himawari-8 Downloader
#
#
#
# This script will scrape the latest image from the Himawari-8 satellite, recombining the tiled image,
# converting it to a JPG which is saved in My Pictures\Himawari\ and then set as the desktop background.
#
# http://himawari8.nict.go.jp/himawari8-image.htm
#
@CoolOppo
CoolOppo / Embedding-Executables.md
Last active February 25, 2025 09:16
How to Embed an exe Inside Another exe as a Resource and Then Launch It

Edit 11 years later: I did not write this. Not sure the original source, but thanks to the original author.

How to Embed an exe Inside Another exe as a Resource and Then Launch It

While working on a utility project today, I stumbled upon wanting to embed an executable inside another executable. Sounds fun doesn’t it? And what is even more fun is to be able to launch the embedded exe!

Basically, here’s how it works. You embed Foo.exe inside Bar.exe. And by embed I mean, add Foo.exe as a resource in Bar.exe and then, from Bar.exe’s code, you can launch Foo.exe using CreateProcess().

So before answering the "Why?" lets answer the "How?"

@dmarx
dmarx / dl_reddit_saved_images.py
Created December 6, 2012 15:42
Downloads images from a user's saved links on reddit. Requires manual entry of username and password
"""
This script was written to illustrate libraries that could be used to improve upon
the efficiency of a script posted to /r/learnprogramming:
Original script:
https://github.com/aesptux/download-reddit-saved-images/blob/master/script.py
Reddit post
http://www.reddit.com/r/learnprogramming/comments/14dojd
/pythoncode_review_script_to_download_saved_images/
"""
from urllib2 import Request, urlopen
@dahu
dahu / gist:3986511
Last active November 18, 2024 09:34
Vim Motions
Large Object Motions:
(
)
{
}
[[
[]
][
]]
[m
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs