Skip to content

Instantly share code, notes, and snippets.

View kmwhite's full-sized avatar
😈
Tinkering

Kristofer M White kmwhite

😈
Tinkering
View GitHub Profile
@xsqian
xsqian / alter-kafka-partitions.sh
Last active October 11, 2023 19:04
How to alter kafka partitions
# create a topic with specified partitons
kafka-topics --bootstrap-server xx.xx.xx.xx:39092 --create --partitions 2 --topic test-partitions
kafka-topics --bootstrap-server xx.xx.xx.xx:39092 --describe --topic test-partitions
# create a topic with default partitions
kafka-topics --bootstrap-server xx.xx.xx.xx:39092 --create --topic test-def-partitions
kafka-topics --bootstrap-server xx.xx.xx.xx:39092 --describe --topic test-def-partitions
# alter the number of partitions of an existing topic
kafka-topics --bootstrap-server xx.xx.xx.xx:39092 --alter --topic test-def-partitions --partitions 3
@ghoomfrog
ghoomfrog / uvector.h
Last active February 8, 2023 17:13
My vector implementation for C.
/* MIT License
Copyright (c) 2019-2020 Unlimiter
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 permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@j33ty
j33ty / print-memory.go
Created May 22, 2019 20:54
Go print current memory
package main
import (
"runtime"
"fmt"
"time"
)
func main() {
// Print our starting memory usage (should be around 0mb)
@umayr
umayr / README.md
Last active September 29, 2023 16:40
Dracula color scheme for FZF

Dracula Color Scheme for FZF

Preview

if you're using fish shell, you can add this in your fish config:

let g:fzf_colors = {
\ 'fg': ['fg', 'Normal'],
\ 'bg': ['bg', 'Normal'],
@Blquinn
Blquinn / scheduler_lock.go
Last active April 29, 2024 22:53
Global scheduler lock implementation using redis, daily scheduled task using redis + db
package main
import (
"github.com/go-redis/redis"
"github.com/jmoiron/sqlx"
_ "github.com/lib/pq"
"github.com/robfig/cron"
"github.com/sirupsen/logrus"
"time"
)
@santiagoprieto
santiagoprieto / aws-ami-codedeploy-agent.md
Last active April 11, 2023 19:57
AWS: How to remove baked in CodeDeploy Agent from AMI and set as User Data

AWS How to:

Remove baked in CodeDeploy Agent from AMI and set as User Data

It is a best practice to not have the CodeDeploy Agent baked into the AMI because AWS will update to new versions quite often. Once they deprecate a version, the AMI will stop being able to deploy new instances, therefore breaking the whole pipeline.

Instead, AWS recommends this CodeDeploy Agent install to be set as User Data within the EC2 Launch Configuration. Because we use CodePipline, CodeDeploy, Auto Scaling Groups, and Load Balancers, we need to change many interlaced pieces.

Instructions:

@danielalvarenga
danielalvarenga / puma.rb
Last active October 16, 2021 20:08
Puma config for rails 5 api
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
# More: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#threads
#
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
threads threads_count, threads_count
@Voronoff
Voronoff / wsl_setup.md
Last active September 29, 2023 16:41
Windows development in 2018: Setting up a coding environment using Windows Subsystems for Linux (WSL), Hyper, and Visual Studio Code (vscode) with Python.

If you're here just for the section on vscode working with Python on WSL, jump here.

Creating a modern development environment in Windows

Windows is now a development environment that can compete with Mac and Linux. Windows Subsystems for Linux lets you have an Ubuntu (or other Linux flavor) installation that works near seemlessly inside of Windows. Hyper Terminal running WSL's Bash and Visual Studio Code feel really nice to code in. These are instructions for getting set up and smoothing out most of the remaining rough edges. I've included a section on getting vscode to work well with Python and WSL, but the general pattern should be usable for any unsupported language (as of now, I believe it's only Node.js that has WSL support in vscode).

Table of Contents

@bbonamin
bbonamin / Brewfile
Last active July 10, 2024 14:07
Capybara Selenium Webdriver: Headless Chrome (with file downloads!) & Headless Firefox
tap "caskroom/cask"
cask "google-chrome"
cask "firefox"
brew "chromedriver"
brew "geckodriver"
@gyribeiro
gyribeiro / tmux_italic.md
Last active May 2, 2024 16:28
enable italic font on tmux