This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo "usage: ffmpeg_thumbnails.sh PATH_TO_VIDEOFILE" | |
exit | |
fi | |
MOVIE=$1 | |
MOVIE_NAME=$(basename "$MOVIE") | |
OUT_FILENAME="${MOVIE_NAME%.*}_preview.jpeg" | |
OUT_DIR=$(pwd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
PYVERSION=$1 | |
clang_flags="PATH=/usr/lib/llvm-18/bin/:$PATH CC=clang-18 CXX=clang++-18 LLVM=-18 LD=ld.lld-18" | |
cd /tmp/ | |
wget -O - "https://www.python.org/ftp/python/$PYVERSION/Python-$PYVERSION.tar.xz" | tar xJ | |
cd "Python-$PYVERSION" | |
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install -y build-essential gdb lcov pkg-config \ | |
libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev \ | |
libncurses5-dev libncursesw5-dev libreadline6-dev libreadline-dev libsqlite3-dev libssl-dev \ | |
lzma lzma-dev xz-utils tk-dev uuid-dev zlib1g-dev libnss3-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
workers = 2; | |
devices: ( | |
{ | |
name: "Wireless Mobile Mouse MX Anywhere 2S"; | |
smartshift: | |
{ | |
on: true; | |
threshold: 0; | |
default_threshold: 0; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"errors" | |
"fmt" | |
"time" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/hmac" | |
"crypto/rand" | |
"crypto/sha512" | |
"encoding/base64" | |
"errors" | |
"hash/fnv" | |
"io" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type DateTime time.Time | |
const iso8601 = "2006-01-02 15:04:05Z07:00" | |
func (dt DateTime) AsTime() time.Time { | |
return time.Time(dt) | |
} | |
func (dt DateTime) Format(layout string) string { | |
return dt.AsTime().Format(layout) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/x509" | |
"encoding/pem" | |
"fmt" | |
"os" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func NewBufferPool(bufsize int) BufferPool { | |
if bufsize <= 0 { | |
bufsize = bytes.MinRead | |
} | |
return BufferPool{pool: &sync.Pool{New: func() any { | |
return bytes.NewBuffer(make([]byte, 0, bufsize)) | |
}}} | |
} | |
type BufferPool struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func merge[T any, C chan T](cs ...C) C { | |
out := make(C) | |
var wg sync.WaitGroup | |
wg.Add(len(cs)) | |
for i := range cs { | |
go func(c C) { | |
defer wg.Done() | |
for value := range c { | |
out <- value | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Execution sequence: | |
1) main | |
2) writeExcel | |
3) writeWheet | |
4) iteration write row | |
*/ | |
package main |
NewerOlder