Skip to content

Instantly share code, notes, and snippets.

@stvhwrd
stvhwrd / LeetCodeQuestions.md
Last active September 7, 2024 13:16 — forked from krishnadey30/LeetCodeQuestions.md
Curated List of Top 75 LeetCode
@stvhwrd
stvhwrd / curl_loop.sh
Last active December 21, 2019 02:01
Submit CURL requests in a loop with approximate RPS calculation
# Submit CURL requests in a loop with rough RPS calculation
# Example usage: `make_requests 10.0.5.28`
_call($1) {
num_requests=0;
start_time="$(date -u +%s)";
base_url="$1/entities/"
sleep_time=5
@stvhwrd
stvhwrd / curl_loop_RPS.sh
Created November 13, 2019 23:19
Submit CURL requests in a loop with rough RPS calculation
# Submit CURL requests in a loop with rough RPS calculation
run() {
num_requests=0;
start_time="$(date -u +%s)";
base_url="localhost/entities/"
while :; do
endpoint={base_url}$(date +"%S")
echo "Sending request to ${endpoint}..."
curl -s -o /dev/null -w "Response: %{http_code}\n" ${endpoint}
@stvhwrd
stvhwrd / .. Sync Settings for Sublime Text
Last active October 28, 2021 15:39
Sync Settings for Sublime Text 3
https://packagecontrol.io/packages/Sync%20Settings
@stvhwrd
stvhwrd / Makefile
Created March 25, 2019 23:39 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@stvhwrd
stvhwrd / protobuf-from-source.md
Last active November 12, 2019 17:15 — forked from diegopacheco/latest-protobuf-ubuntu-18-04.md
How to Install Latest Protobuf on Ubuntu 18.04

Building from Source

sudo apt install autoconf automake libtool curl make g++ unzip -y
git clone https://github.com/google/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
./configure
make
# Update
find . -type d -name .git -exec sh -c "cd \"{}\"/../ && pwd && git stash && git fetch -a && git checkout master && git pull && git stash pop" \;
@stvhwrd
stvhwrd / _README.md
Last active March 27, 2019 18:54
SENG 468 VM Setup Script

SENG 468 Lab Setup script

This is one opinionated installer script with tons of string hardcodes just to make installation quicker and easier.

What Does It Install?

Packages and Utilities

  • apt-transport-https
@stvhwrd
stvhwrd / py2registry.py
Created December 23, 2018 20:40
script to register Python 2.0 or later for use with Python extensions that require Python registry settings in Windows
#
# script to register Python 2.0 or later for use with
# Python extensions that require Python registry settings
#
# written by Joakim Loew for Secret Labs AB / PythonWare
#
# source:
# http://www.pythonware.com/products/works/articles/regpy20.htm
#
# modified by Valentine Gogichashvili as described in http://www.mail-archive.com/distutils-sig@python.org/msg10512.html
@stvhwrd
stvhwrd / wysiwyg.js
Created November 22, 2018 02:43
Turn webpage into WYSIWYG editor
/* Run this in console of dev tools in browser to make all text on rendered page editable (but retains style etc) */
javascript:document.body.contentEditable='true'; document.designMode='on'; void 0