Skip to content

Instantly share code, notes, and snippets.

@onlurking
onlurking / Ruby and Rails Study Roadmap.md
Created February 25, 2019 23:58
Ruby and Rails Study Roadmap
@karstenmueller
karstenmueller / aws_az_list.md
Created December 1, 2016 18:26
List of AWS availability zones for each AWS region

AWS Regions

Region Code Region Name Availability Zones
us-east-1* N. Virginia us-east-1a us-east-1b us-east-1c us-east-1d us-east-1e
us-east-2 Ohio us-east-2a us-east-2b us-east-2c
us-west-1* N. California us-west-1a us-west-1b us-west-1c
us-west-2 Oregon us-west-2a us-west-2b us-west-2c
eu-west-1 Ireland eu-west-1a eu-west-1b eu-west-1c
eu-central-1 Frankfurt eu-central-1a eu-central-1b
@kimus
kimus / ufw.md
Created March 2, 2014 22:46
NAT and FORWARD with Ubuntu’s ufw firewall

UFW

I use Ubuntu’s Uncomplicated firewall because it is available on Ubuntu and it's very simple.

Install UFW

if ufw is not installed by default be sure to install it first.

@phuslu
phuslu / cachingmap.go
Last active May 9, 2024 03:50
双缓冲实现无锁map,读取性能和GC友好度最好,一致性较差,写入延迟一般建议设置为分钟级。 https://twitter.com/phuslu/status/1745276311235395708
type CachingMap[K comparable, V any] struct {
// double buffering mechanism
index int64
maps [2]map[K]V
// write queue
queue chan struct {
key K
value V
}
@stephenhardy
stephenhardy / git-clearHistory
Created April 26, 2013 22:14
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git

Getting Started with Clojure on Windows

Clojure is an amazingly powerful language. Using it (and watching Rich Hickey videos) has changed the way I think about programming, and the way I code in general. Once I learned the basics of the language, which was a relatively quick process, I fell in love and couldn't look back. I hope this post can help others who are new to Clojure get up and running quickly and painlessly.

This post is opinionated in the sense that I'll suggest certain tools to help those who are new to this scene get on their feet. The things you'll need are:

  • Leiningen (pronounced LINE-ing-en) - This is like a package manager, build tool, task manager, and more in one tool. Think npm or nuget, but with more capabilities. There is at least one other build tool for Clojure (boot), but Leiningen is the most widely used.
  • JDK - Clojure runs on Java. Throw out any qualms you may have about Java, we aren't coding in Java (though we can through Clojure, and sometimes tha
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 9, 2024 03:42
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@hurricane-voronin
hurricane-voronin / README.md
Last active May 9, 2024 03:41
Naming Classes Without a 'Manager'
@s5bug
s5bug / 01a.md
Last active May 9, 2024 03:41
Advent of Code solved in Hex Casting

Accepts input as a list of UTF-32 codepoints and returns a Number.

High-Level

let isNewline: Number -> Boolean =
  (x: Number) -> x == 10

let isDigit: Number -> Boolean =
  (x: Number) -> (x >= 48) && (x < 58)
@s5bug
s5bug / 0_initial_brainstorming.md
Last active May 9, 2024 03:41
Hex Casting compiler ideas

Basic Control Flow

Given an arbitrary program:

@main def lcm(a: Int, b: Int): Int =
  if(a < b) (a * (b / gcd(b, a))
  else (b * (a / gcd(a, b))

def gcd(a: Int, b: Int): Int =
  if(b == 0) a