A very brief guide to Rust syntax. It assumes you are already familiar with programming concepts.
This was written in 2014. It is not a good reference for Rust today, though the content is still correct.
cheats.rs looks like a good alternative.
A very brief guide to Rust syntax. It assumes you are already familiar with programming concepts.
This was written in 2014. It is not a good reference for Rust today, though the content is still correct.
cheats.rs looks like a good alternative.
| #! /usr/bin/env bash | |
| # | |
| # Monkey patching a function in bash. Why. | |
| patch() { | |
| new_guy=$(declare -f $1) | |
| new_guy=${new_guy##$1*\{} | |
| new_guy=${new_guy/\}/} | |
| old_guy=$(declare -f $2) | |
| old_guy=${old_guy/$2*{/} |
| #~/.mutt/aliases | |
| alias nick Nicholas Levandoski <nick.levandoski@auglug.org> | |
| alias tim Timothy Pitt <timothy.pitt@auglug.org> | |
| alias steven Steven Jackson <sjackson@auglug.org> | |
| alias kaleb Kaleb Hornsby <kaleb.hornsby@auglug.org> | |
| alias alug-admin nick, tim, steven |
JavaScript Code
var str = "hi";Memory allocation:
| Address | Value | Description |
|---|---|---|
...... |
... |
| function endianness () { | |
| var b = new ArrayBuffer(4); | |
| var a = new Uint32Array(b); | |
| var c = new Uint8Array(b); | |
| a[0] = 0xdeadbeef; | |
| if (c[0] == 0xef) return 'LE'; | |
| if (c[0] == 0xde) return 'BE'; | |
| throw new Error('unknown endianness'); | |
| } |
| ## Install kernel modules | |
| mkdir -p ~/work/share/lcd/adafruit-pitft-2.8 | |
| cd ~/work/share/lcd/adafruit-pitft-2.8 | |
| wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-bin-adafruit.deb | |
| wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-dev-adafruit.deb | |
| wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-doc-adafruit.deb | |
| wget http://adafruit-download.s3.amazonaws.com/libraspberrypi0-adafruit.deb | |
| wget http://adafruit-download.s3.amazonaws.com/raspberrypi-bootloader-adafruit-20140724-1.deb |
Recent releases have been pre-built using cross-compilers and this script and are downloadable below.
If you have found these packages useful, give me a shout out on twitter: @adammw
| Mac OSX keyboard layout switching is a pain. | |
| Using a keyboard layout different than the one actually printed on | |
| your keys is also weird. The following keyboard shortcuts allow you | |
| to create the various diacritics used in languages like Portuguese | |
| on the British/US layout of a Mac keyboard. | |
| Alt+e -> ´ Examples: é ó á | |
| Alt+i -> ^ Examples: â ê | |
| Alt+c -> ç |