Skip to content

Instantly share code, notes, and snippets.

View pushshift's full-sized avatar

Jason Michael Baumgartner pushshift

View GitHub Profile
@ishad0w
ishad0w / sources.list
Created April 30, 2020 16:55
Ubuntu 20.04 LTS (Focal Fossa) -- Full sources.list
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
@pklaus
pklaus / pg_test_fsync
Last active March 12, 2020 15:21
PostgreSQL Benchmarks with pgbench and pg_test_fsync on an Intel Optane 900P 480GB PCIe SSD (where the PostgreSQL instance is running in a Docker container with the PGDATA volume and the Docker image store located on the Optane SSD)
$ uname -a
Linux 5fc03a999611 4.15.3-2-ARCH #1 SMP PREEMPT Thu Feb 15 00:13:49 UTC 2018 x86_64 Linux
$ cat /etc/issue
Welcome to Alpine Linux 3.6
Kernel \r on an \m (\l)
$ pg_config --version
PostgreSQL 10.1
$ cd /var/lib/postgresql/data/
$ pg_test_fsync
@stpe
stpe / youtube_topicIDs.md
Last active April 23, 2025 02:23
YouTube Topic IDs

Music topics

  • /m/04rlf Music
  • /m/05fw6t Children's music
  • /m/02mscn Christian music
  • /m/0ggq0m Classical music
  • /m/01lyv Country
  • /m/02lkt Electronic music
  • /m/0glt670 Hip hop music
  • /m/05rwpb Independent music
@zhum
zhum / go-sort-insert.go
Created April 30, 2015 09:38
Golang function to insert in sorted array
// Mytype must implement Less func.
func SortedInsert (s []Mytype, f Mytype) []Mytype {
l:=len(s)
if l==0 { return [f] }
i := sort.Search(l, func(i int) bool { return s[i].Less(f)})
if i==l { // not found = new value is the smallest
return append([f],s)
}
@thomasdarimont
thomasdarimont / Redis_Stats.md
Last active January 31, 2023 17:27
Example for computing various running statistics with Lua in Redis backed by a hash

Running statistics with Redis and Lua

This is an example for computing running statistics with Lua backed by a hash in Redis. We support counting, average (with and without exponential smoothing), stddev, variance, min, max, sum of observed values. An example for approximating a running median can be found here: https://gist.github.com/thomasdarimont/fff68191d45a001b2d84

Data structure

We use a hash for storing various statistic value under the key "stats_value" in redis. Note: If you need a specific alpha value for smoothing the average, then set the desired alpha -> e.g. alpha 0.7. If alpha is 0.0 then no smoothing is applied.

@hiway
hiway / auth.py
Last active July 20, 2023 15:56
A bare-minimum implementation of Twitter's Streaming API using python-requests library. Prints out tweets as they come in.
consumer_key = ''
consumer_secret = ''
access_token = ''
access_token_secret = ''