Skip to content

Instantly share code, notes, and snippets.

View TheHackerDev's full-sized avatar

Aaron Hnatiw TheHackerDev

View GitHub Profile
@TheHackerDev
TheHackerDev / part1.cs
Last active December 19, 2015 16:49
Solution for InvalidOperationException: "Cross-thread operation not valid: Control '<name>' accessed from a thread other than the thread it was created on."
private void delegate MyDelegate(); // This is the delegate that will be invoked from the main thread if needed
@TheHackerDev
TheHackerDev / Makefile
Created October 6, 2016 19:41
Golang Makefile for easy builds
# File name
DIR := bin
PREFIX := race-the-web
TAG := $(shell git describe --always --dirty --tags)
# Build command
CMD_BUILD := go build -o $(DIR)/$(PREFIX)_$(TAG)_
# Environment variables for build
ENV_OSX64 := GOOS=darwin GOARCH=amd64
@TheHackerDev
TheHackerDev / ReadResponseBody.go
Last active May 23, 2017 14:30
A helper function to read the content from an `http.Response` body and refill the body with another `io.ReadCloser`, so that it can be read again.
import (
"bytes"
"io/ioutil"
"net/http"
)
// Function readResponseBody is a helper function to read the content from a response's body,
// and refill the body with another io.ReadCloser, so that it can be read again.
func readResponseBody(resp *http.Response) (content []byte, err error) {
// Get the content
@TheHackerDev
TheHackerDev / 301.py
Created June 12, 2017 13:43
Simple 301 redirect server in Python
import SimpleHTTPServer
import SocketServer
# Redirect to Google.com
class Redirect(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self):
print self.path
self.send_response(301)
new_path = '%s%s'%('https://google.com', self.path)
self.send_header('Location', new_path)
@TheHackerDev
TheHackerDev / Blockchain security research.md
Last active May 1, 2023 13:49
Open-source blockchain security research (contributions welcome!)

What is a blockchain?

  • Distributed ledger system; for tracking the transfer of tokens (currency, data of any type).
  • A cross between economics, cryptography, and the internet.
    • Side note- if you ever wanted a financial incentive to get involved in cryptography, this is it.
  • A blockchain is literally a chain of blocks, where each block contains a list of transactions that everyone agrees have occurred.
    • Each block builds upon all the ones before it.

A blockchain is literally a chain of blocks

Keybase proof

I hereby claim:

  • I am thehackerdev on github.
  • I am thehackerdev (https://keybase.io/thehackerdev) on keybase.
  • I have a public key ASDu1dsuBEHadlU4aEIOYyb5mI6ThFtCilJbxtaKLoEbjgo

To claim this, I am signing this object: