Skip to content

Instantly share code, notes, and snippets.

@vmihailenco
vmihailenco / proxy.go
Created November 20, 2011 15:22
Simple TCP proxy in Golang
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@jpmx
jpmx / hack.sh
Created November 19, 2012 14:40 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
# 'ab' program freezes after lots of requests, why?
# http://stackoverflow.com/questions/1216267/ab-program-freezes-after-lots-of-requests-why
# Enter sudo mode
sudo -i
# net.inet.ip.portrange.first: 49152 -> 32768
sysctl -w net.inet.ip.portrange.first=32768
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active April 1, 2024 11:21
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@jyap808
jyap808 / encrypt_decrypt_gpg_armor.go
Created January 4, 2014 01:12
Symmetrically encrypting a string into ASCII armored GPG format and then Decrypting it in Golang
package main
import (
"bytes"
"code.google.com/p/go.crypto/openpgp"
"code.google.com/p/go.crypto/openpgp/armor"
"fmt"
"io/ioutil"
"log"
)
@jarcoal
jarcoal / mock.go
Created February 11, 2014 18:29
http mock for golang
package httpmock
import (
"errors"
"net/http"
)
// Responders are callbacks that receive and http request and return a mocked response.
type Responder func(*http.Request) (*http.Response, error)
@ismasan
ismasan / sse.go
Last active March 19, 2024 18:13
Example SSE server in Golang
// Copyright (c) 2017 Ismael Celis
// 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:
// The above copyright notice and this permission notice shall be included in all
@cryptix
cryptix / LICENSE
Last active March 10, 2024 09:55
example of using JWT for http authentication in go
MIT License
Copyright (c) <year> <copyright holders>
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:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE S
@staltz
staltz / introrx.md
Last active May 10, 2024 12:08
The introduction to Reactive Programming you've been missing
@apparentlymart
apparentlymart / Makefile
Created September 14, 2014 02:16
LLVM Protothreads Implementation
protothread: protothread.o
gcc protothread.o -o protothread
protothread.o: protothread.s
as protothread.s -o protothread.o
protothread.s: protothread.ll
llc-3.4 protothread.ll