Skip to content

Instantly share code, notes, and snippets.

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

#!/usr/bin/env python
__author__ = "m.busche@gmail.com"
# This program lets your blink1 device blink whenever Pi-hole has filtered ads
# Have fun.
# blink1 commandline tool: https://github.com/todbot/blink1/blob/master/docs/blink1-tool.md
# Pi-hole https://github.com/pi-hole/pi-hole
# To start this as a service I would recommend using supervisord
@ttscoff
ttscoff / voices.txt
Created April 20, 2015 20:48
Voices available to say command on OS X 10.10.3
# Voices available to `say` on OS X
# "*" indicates new additions since 10.8
Agnes (en_US)
Albert (en_US)
Alex (en_US)
*Alice (it_IT)
*Alva (sv_SE)
*Amelie (fr_CA)
*Anna (de_DE)
@stonehippo
stonehippo / smartcore_arduino_pin_mapping.md
Last active January 5, 2019 22:07
Mapping Smartmaker Smartcore CPU pins to Arduino pins.

Pin Mapping the Smartmaker Smartcores to Arduino Pins

This note details the pin mappings for the Smartmaker Smartcore microcontrollers to Arduino standards pins.

Smartmaker Smartcore: A Brief Intro

The Smartmaker1 Smartcores are small-form-factor Arduino clones.

The special thing about Smartcores is their use of the Smartmaker Open System I/O Smartbus, which is basically a snap-together bus interface for components based on pairs of the Hirose DF9-31 connector. There are two flavors of the bus, Smartbus Basic with two connector (A+B) and Smartbus Full which add two additional connectors (A+B+C+D). Each connector has 31 pins, which are assigned different purposes. The Smartmaker Wiki has more details on the Smartbus configuration.

@sloria
sloria / bobp-python.md
Last active July 21, 2024 04:44
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@esc
esc / anaconda.sh
Last active October 8, 2018 21:06
Anconda activation and deactivation functions for ZSH
# Functions to activate/deactivate Continuum Analytics Anaconda Python distribution
# by manipulating the $PATH.
export ANACONDA_PATH="$HOME/anaconda/bin"
function have_anaconda(){
[[ -n $path[(r)$ANACONDA_PATH] ]]
}
function anaconda_on(){
if have_anaconda ; then
@pegli
pegli / gist:2996514
Created June 26, 2012 15:39
postal.js and machina.js in Titanium
// setting up postal and machina to work together
/*
1. Download underscore.js and the node versions of postal.js, machina.js, and machina-postal.js
from http://github.com/ifandelse
2. Change the location of underscore in the require() statements of the postal.js and machina.js
3. Connect machina to postal as follows:
*/
var postal = require('lib/ifandelse/postal'),
@nicerobot
nicerobot / README.md
Last active June 18, 2024 19:46
Mac OS X uninstall script for packaged install of node.js from https://stackoverflow.com/a/9287292/23056

To run this, you can try:

curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh
chmod +x ./uninstall-node.sh
./uninstall-node.sh
rm uninstall-node.sh
@boj
boj / SimplexNoise.cs
Created February 7, 2012 14:14
Stefan Gustavson's "Simplex noise demystified" in C# + Unity3d Mathf methods.
using UnityEngine;
using System.Collections;
// copied and modified from http://webstaff.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
public class SimplexNoise { // Simplex noise in 2D, 3D and 4D
private static int[][] grad3 = new int[][] {
new int[] {1,1,0}, new int[] {-1,1,0}, new int[] {1,-1,0}, new int[] {-1,-1,0},
new int[] {1,0,1}, new int[] {-1,0,1}, new int[] {1,0,-1}, new int[] {-1,0,-1},
new int[] {0,1,1}, new int[] {0,-1,1}, new int[] {0,1,-1}, new int[] {0,-1,-1}};
@lukebayes
lukebayes / each_file_matching.js
Created February 7, 2011 06:20
NodeJS (or CommonJS?) code to recursively traverse directories triggering the provided callback each time a regex matches a file name.
var fs = require("fs");
/**
* Call fileHandler with the file name and file Stat for each file found inside
* of the provided directory.
*
* Call the optionally provided completeHandler with an array of files (mingled
* with directories) and an array of Stat objects (one for each of the found
* files.
*