Skip to content

Instantly share code, notes, and snippets.

View michaeldwan's full-sized avatar
🍩

Michael Dwan michaeldwan

🍩
View GitHub Profile
@alirobe
alirobe / reclaimWindows10.ps1
Last active April 14, 2024 11:40
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@ericflo
ericflo / proxy.go
Last active April 17, 2024 21:27
Golang TCP Proxy
package proxy
import (
"io"
"net"
"sync"
log "github.com/Sirupsen/logrus"
)
@twobitlabs
twobitlabs / gist:4226365
Created December 6, 2012 17:35
Blocks cheat sheet
// http://cocoawithlove.com/2009/10/ugly-side-of-blocks-explicit.html has a nice breakdown of the syntax--it helps to think of the ^ as similar to a pointer dereference symbol *
// block typedef:
typedef void(^Block)();
typedef void(^ConditionalBlock)(BOOL);
typedef NSString*(^BlockThatReturnsString)();
typedef NSString*(^ConditionalBlockThatReturnsString)(BOOL);
// block property with typedef:
@myobie
myobie / mountain-lion-brew-setup.markdown
Created February 18, 2012 20:14
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@ryandotsmith
ryandotsmith / memstat.rb
Created July 29, 2011 05:04
I am using this to profile my workers (queue_classic)
module Memstat
extend self
def puts
"memory=#{real_mem_size} ruby_objects=#{num_objects}"
end
def real_mem_size
mb = `ps -o rsz #{$$}`.split("\n")[1].to_f / 1024.0
mb = mb.round(-2) # nearest 100 (i.e. 60.round(-2) == 100)
# silly but useful.
# -> compresses nested hashes into dot separated key value pairs
class Hash
def nested_flatten(prefix = 'h')
arr = []
each do |key, value|
k = prefix + ".#{key}"
build:
@echo "Combining files ..."
@cat \
js/dep/jquery.easing.js \
js/dep/jquery.jsonp.js \
js/dep/json2.js \
js/dep/toolbox.expose.js \
js/lib/jquery.transloadit2.js > build/jquery.transloadit2.js
@echo "Compiling with Closure REST API ..."
@curl \
@bitzesty
bitzesty / config.enviroment.rb
Created January 4, 2010 22:58
Getting up and running with MongoDB/MongoMapper
# config/enviroment.rb
config.gem 'mongo'
config.gem 'mongo_mapper'
# remove AR
config.frameworks -= [ :active_record, :active_resource ]