Skip to content

Instantly share code, notes, and snippets.

View denisbrodbeck's full-sized avatar

Denis Brodbeck denisbrodbeck

View GitHub Profile
#!/bin/vbash
# CONFIG
wan=dhcp
lan=192.168.1.1
lan_segment=192.168.1.0
vpn_segment=192.168.5.0
domain=apertoire.org
lease_start=192.168.1.200
lease_stop=192.168.1.245
@denisbrodbeck
denisbrodbeck / fetch.go
Created June 27, 2018 11:08 — forked from hriddhidey/fetch.go
Fetch makes network calls using the method (POST/GET..), the URL // to hit, headers to add (if any), and the body of the request. This function can serve as a singular resource for all your network calls to pass through, thus becoming an http interceptor. You may add a lot of n/w layer related customizations here as you wish - headers, auth, red…
// Fetch makes network calls using the method (POST/GET..), the URL // to hit, headers to add (if any), and the body of the request.
// Feel free to add more stuff to before/after making the actual n/w call!
func Fetch(method string, url string, header map[string]string, body io.Reader) (*http.Response, err) {
// Create client with required custom parameters.
// Options: Disable keep-alives, 30sec n/w call timeout.
client := &http.Client{
Transport: &http.Transport{
DisableKeepAlives: true,
},
Timeout: time.Duration(10 * time.Second),
<?
// <readme>
/*
This is a lite version of Olark's and Intercom's functionality (without the chat part).
It lets you get feedback from users on your site to your email.
And you won't have to rely on another company anymore!
#killyourdependencies
@denisbrodbeck
denisbrodbeck / IAmDisposable.cs
Created December 15, 2015 21:04 — forked from jcdickinson/IAmDisposable.cs
Disposers done right.
class IAmDisposable : IDisposable
{
private int _isDisposed;
private SomeDisposableThing _disposable1;
private SomeDisposableBar _disposable2;
private SomeDisposableBaz _disposable3;
// Only if you **need** it. You don't though, use SafeHandle.
//~IAmDisposable()
//{