Skip to content

Instantly share code, notes, and snippets.

View travishaagen's full-sized avatar
😑

Travis Haagen travishaagen

😑
View GitHub Profile
@AniFichadia
AniFichadia / $KtorReverseProxy.kt
Last active June 13, 2021 14:53
Ktor reverse proxy that forwards the entire request contents (including the body). This is based off https://github.com/ktorio/ktor-samples/blob/1.3.0/other/reverse-proxy/src/ReverseProxyApplication.kt
package com.anifichadia.ktorreverseproxy
import io.ktor.application.Application
import io.ktor.application.ApplicationCallPipeline
import io.ktor.application.ApplicationStopping
import io.ktor.application.call
import io.ktor.application.install
import io.ktor.application.log
import io.ktor.client.HttpClient
import io.ktor.client.features.HttpTimeout
package main
import (
"bytes"
"encoding/json"
"fmt"
"image/jpeg"
"net"
"net/http"
"os"
@xjdrew
xjdrew / client.go
Last active January 22, 2024 05:49
golang tls client and server, require and verify certificate in double direction
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io"
"io/ioutil"
"log"
"os"
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active April 7, 2024 22:55
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@Lahorde
Lahorde / 0_README.md
Last active August 11, 2023 16:52
Initialize an external I2C RTC module on raspberry using udev and systemd

Description

Enable i2c RTC using systemd. A udev rules triggers an I2C systemd service on I2C kernel module adding. Service then loads I2C driver adding a new I2C device to /sys Then kernel loads I2C RTC driver and adds an RTC device It triggers a udev rules that updates hardware clock

Application on raspberry pi

Enable I2C

  • enable I2C in config.txt, adding device_tree_param=i2c1=on
@pokstad
pokstad / gaereverseproxy.go
Last active October 24, 2021 09:35
Google App Engine reverse proxy in Golang
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// HTTP reverse proxy handler
package goengine
import (
"io"
@Joopmicroop
Joopmicroop / Helper functions
Last active November 13, 2019 10:36
dom helper functions
function CssHelper(){
// checkers
this.isPx = function isPx(v){ return /px/gi.test(v); };
this.isPc = function isPc(v){ return /%|pc/gi.test(v); };
this.isVal = function isVal(v){ return !isNaN(v); };
// converters
this.toVal = function toVal(v){ return parseFloat(v); };
this.toUnit = function toUnit(unit, v){ return this.toVal(v)+unit; };
this.toPx = this.toUnit.bind(this, 'px');
this.toPc = this.toUnit.bind(this, '%');
@sebnash
sebnash / gist:3851742
Last active May 1, 2020 12:51
Disable Meraki System Manager client remote desktop, screenshots (OS X)
curl -L --create-dirs -o /etc/meraki/ci.conf http://dl.meraki.net/sm/ci.conf