Skip to content

Instantly share code, notes, and snippets.

View pcdavid's full-sized avatar

Pierre-Charles David pcdavid

View GitHub Profile
@stfwn
stfwn / nn.py
Last active December 21, 2020 04:32
A Neural Network in Python From Start to Finish
import numpy as np
import matplotlib.pyplot as plt
from urllib import request
import gzip
import pickle
import os
"""Load up the data.
This is not that interesting. Let's just copy paste it from https://github.com/hsjeong5/MNIST-for-Numpy."""
@shivekkhurana
shivekkhurana / install-docker.sh
Created January 16, 2020 08:08
Install Docker and Docker Compose on a Ubuntu Machine (Tested on AWS)
#!/bin/sh
set -eu
# Docker
sudo apt remove --yes docker docker-engine docker.io || true
sudo apt update
sudo apt --yes --no-install-recommends install apt-transport-https ca-certificates
wget --quiet --output-document=- https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@ericnormand
ericnormand / 00_script.clj
Last active January 6, 2024 07:13
Boilerplate for running Clojure as a shebang script
#!/bin/sh
#_(
#_DEPS is same format as deps.edn. Multiline is okay.
DEPS='
{:deps {clj-time {:mvn/version "0.14.2"}}}
'
#_You can put other options here
OPTS='
@CodyReichert
CodyReichert / react-es6-flow-emacs-configuration.md
Last active September 26, 2023 05:56
Configuring Emacs for react, es6, and flow

Configuring Emacs for react, es6, and flow

For a while, JSX and new es6 syntax had flaky support in emacs, but there's been huge work on a lot of packages. Using emacs for JavaScript with React, ES6, and Flow (or Typescript, etc) is really easy and powerful in Emacs these days.

This is how you can work on modern web development projects with full support for tooling like JSX, Flow types, live eslint errors, automatic prettier.js formatting, and more.

Set up web-mode

web-mode provides most of the underlying functionality, so a huge shout-out to the maintainer(s) there.

@kingargyle
kingargyle / linkrepo.sh
Created March 24, 2013 14:48
Profile for deploying a p2 repo, to a specified directory and providing a symbolic link for the most current version deployed. Run this as part of a release profile with your maven tycho build.
<profiles>
<profile>
<id>release-profile</id>
<properties>
<p2repo-dir>${basedir}/target/deployed-repository</p2repo-dir>
<buildNumber>${project.version}.${maven.build.timestamp}</buildNumber>
</properties>
<build>
<plugins>
<plugin>
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real