Skip to content

Instantly share code, notes, and snippets.

View michaelsanford's full-sized avatar

Michael Sanford michaelsanford

View GitHub Profile
@yowu
yowu / HttpProxy.go
Last active March 28, 2024 12:47
A simple HTTP proxy by Golang
package main
import (
"flag"
"io"
"log"
"net"
"net/http"
"strings"
)
@josephspurrier
josephspurrier / values_pointers.go
Last active April 20, 2024 04:58
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active April 20, 2024 16:52
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@grantslatton
grantslatton / hngen.py
Last active September 27, 2021 11:07
A program that uses Markov chains to generate probabilistic Hacker News titles.
import urllib2
import re
import sys
from collections import defaultdict
from random import random
"""
PLEASE DO NOT RUN THIS QUOTED CODE FOR THE SAKE OF daemonology's SERVER, IT IS
NOT MY SERVER AND I FEEL BAD FOR ABUSING IT. JUST GET THE RESULTS OF THE
CRAWL HERE: http://pastebin.com/raw.php?i=nqpsnTtW AND SAVE THEM TO "archive.txt"
@altrive
altrive / Microsoft.PowerShellISE_profile.ps1
Last active February 7, 2023 07:11
Sample code to defer PowerShell modules loading.
#Register OnIdle event to load PS moduless.
Register-EngineEvent -SourceIdentifier ([Management.Automation.PsEngineEvent]::OnIdle) -MaxTriggerCount 1 -Action {
Import-Module TabExpansion++
#Import-Module FunctionExplorer
Import-Module VariableExplorer
Import-Module PSCodeAnalyzer.ISEAddin
Import-Module Altrive.ISEExtensions
#Remove current Job (No Need to get job result)
$EventSubscriber.Action | Remove-Job -Force -ErrorAction Ignore
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else