Skip to content

Instantly share code, notes, and snippets.

aparrish / understanding-word-vectors.ipynb
Last active Sep 20, 2022
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0, other text released under CC BY 4.0
View understanding-word-vectors.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
nicowilliams /
Last active Aug 30, 2022
fork() is evil; vfork() is goodness; afork() would be better; clone() is stupid

I recently happened upon a very interesting implementation of popen() (different API, same idea) called popen-noshell using clone(2), and so I opened an issue requesting use of vfork(2) or posix_spawn() for portability. It turns out that on Linux there's an important advantage to using clone(2). I think I should capture the things I wrote there in a better place. A gist, a blog, whatever.

> This is not a paper. I assume reader familiarity with fork() in particular and Unix in general, though, of course, I link to relevant wiki pages, so if the unfamiliar reader is willing to go down the rabbit hole, they should be able to come ou

jesperorb /
Last active Sep 17, 2022
Handle CORS Client-side

Handle CORS Client-side

Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside the domain from which the first resource was served. This is set on the server-side and there is nothing you can do from the client-side to change that setting, that is up to the server/API. There are some ways to get around it tho.

Sources : MDN - HTTP Access Control | Wiki - CORS

CORS is set server-side by supplying each request with additional headers which allow requests to be requested outside of the own domain, for example to your localhost. This is primarily set by the header:

yangyuqian / graceful_exit.go
Created Mar 10, 2017
Graceful Exit in Go Program
View graceful_exit.go
* Killing a program immediately sometimes leads to corrupted data or files, which brings unexpected result in your system.
* In Go, you can catch the termination signals and let your program decide the time of exiting.
package main
import (
rajadain / github-hasklig-fira-code-style.css
Last active Feb 6, 2019
Hasklig / Fira Code on GitHub Stylish CSS
View github-hasklig-fira-code-style.css
@-moz-document domain(""), domain(""), domain("") {
/* Hasklig */
/* Fira Code */
/* Ligaturizer */
.CodeMirror pre,
.commit .sha,
.commit-desc pre,
Adron /
Last active May 25, 2022
Installing golang via apt-get
sudo add-apt-repository ppa:ubuntu-lxc/lxd-stable
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install golang
# Usually this is good to install golang, but alas the apt-get repo is usually out of sync with the latest.
nocaoper / CapsLockCtrlEscape.ahk
Last active Jun 26, 2022 — forked from sedm0784/CapsLockCtrlEscape.ahk
Shift_CapsLock gives the original capsLock behaviour.... reload script on error
View CapsLockCtrlEscape.ahk
LShift & Capslock::
SetCapsLockState, % (State:=!State) ? "on" : "alwaysoff"
g_AbortSendEsc := false
SetCapsLockState, alwaysoff
g_DoNotAbortSendEsc := true
yossorion /
Last active Sep 12, 2022
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

sebp /
Last active May 26, 2022
Overview of Python Packages for Scientific Computing
View docker-compose.yml
version: '2'
image: cockroachdb/cockroach:beta-20161215
command: start --insecure
- 8080:8080
- roachnet