Skip to content

Instantly share code, notes, and snippets.

View wc2184's full-sized avatar

William Chan wc2184

View GitHub Profile
@bradtraversy
bradtraversy / npmcrashcourse.txt
Last active January 1, 2026 13:05
NPM Crash Course Commands
# GET VERSION
npm -v (or --version)
# GET HELP
npm help
npm
# CREATE PACKAGE.JSON
npm init
npm init -y (or --yes)
@jimmywarting
jimmywarting / readme.md
Last active January 15, 2026 04:10
Cors proxies
Exposed headers
Service SSL status Response Type Allowed methods Allowed headers
@BrianWill
BrianWill / Go overview.md
Last active August 5, 2025 21:37
Go language overview for experienced programmers

The Go language for experienced programmers

Why use Go?

  • Like C, but with garbage collection, memory safety, and special mechanisms for concurrency
  • Pointers but no pointer arithmetic
  • No header files
  • Simple, clean syntax
  • Very fast native compilation (about as quick to edit code and restart as a dynamic language)
  • Easy-to-distribute executables
@stefanmaric
stefanmaric / copy-to-clipboard-bookmarklet.md
Created September 7, 2016 20:54
Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard

Copy-to-clipboard Bookmarklet

Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard.

This is the base javascript:

(function (text) {
  var node = document.createElement('textarea')
  var selection = document.getSelection()
@vasanthk
vasanthk / System Design.md
Last active January 17, 2026 22:36
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@jconnolly
jconnolly / Amortized.md
Created December 14, 2015 13:51
Amortized vs Average

Meaning of amortized

I feel like I have a vague understanding of what an amortized analysis is. From what I've noticed, it's the time if the action in consideration is done a large number of times (on a large data set?). I know it's in contrast to worst-case cost analysis but if anyone has any helpful ways to explain it and how to find amortized cost, that would be great.

Instructor. 15h

You can think of amortized a little like "average", but there's a subtle difference.

Average involves a random process. Amortized does not.

@gtallen1187
gtallen1187 / slope_vs_starting.md
Created November 2, 2015 00:02
A little bit of slope makes up for a lot of y-intercept

"A little bit of slope makes up for a lot of y-intercept"

01/13/2012. From a lecture by Professor John Ousterhout at Stanford, class CS140

Here's today's thought for the weekend. A little bit of slope makes up for a lot of Y-intercept.

[Laughter]

@AllThingsSmitty
AllThingsSmitty / querySelector.js
Last active August 20, 2022 13:32
Use querySelector with .bind() as a shortcut to familiar function names
// returns first element selected - $('input[name="food"]')
var $ = document.querySelector.bind(document);
// return array of selected elements - $$('img.dog')
var $$ = document.querySelectorAll.bind(document);
// Credit: https://twitter.com/wesbos/status/608341616173182977
@iangreenleaf
iangreenleaf / gist:b206d09c587e8fc6399e
Last active December 23, 2025 06:04
Rails naming conventions

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.

@MilanGrubnic70
MilanGrubnic70 / puts_print_p.md
Last active June 13, 2022 19:22
puts vs. print vs. p

#puts vs. print vs. p ###The 'puts' (short for "put string") and 'print' commands are both used to display the results of evaluating Ruby code. ###Both 'puts' and 'print' call the 'to_s' method on the object AND return nil.

###The primary difference between them is that 'puts' adds a newline after executing, and 'print' does not. ###They don't RETURN anything so the RETURN value is nil. ###Using 'p' calls the 'inspect' method on the object.

print "Milan"
Milan => nil