Skip to content

Instantly share code, notes, and snippets.

Avatar
🚮
bad command or file name

Tim Ryan tcr

🚮
bad command or file name
View GitHub Profile
@Bouke
Bouke / gist:11261620
Last active Sep 29, 2020
Multiple Python installations on OS X
View gist:11261620

Previous versions used homebrew to install the various versions. As suggested in the comments, it's better to use pyenv instead. If you are looking for the previous version of this document, see the revision history.

$ brew update
$ brew install pyenv
$ pyenv install 3.5.0
$ pyenv install 3.4.3
$ pyenv install 3.3.6
$ pyenv install 3.2.6
$ pyenv install 2.7.10
$ pyenv install 2.6.9
View sshcd.sh
# let's assume the command is:
# sshcd -v -q root@example.com:/path/to/file
# grabs the last argument of command, the target: "root@example.com:/path/to/file
t="${!#}"
# command to run, which I've broken down line by line
c=(
"ssh"
"-t" # force pseudo-tty allocation (http://www.openbsd.org/cgi-bin/man.cgi?query=ssh&sektion=1)
@z0w0
z0w0 / haul.md
Last active Feb 9, 2017
Haul, a purely functional package manager for Rust
View haul.md

Haul

Features

  • Purely functional
    • Different versions of packages can coexist
    • Each package must have a UUID, so packages with conflicting names can coexist
  • Build logic
    • Each package's metadata and build logic is written in a central Rust source file, package.rs
    • Dependencies are declared in the package file and will be fetched and installed before
@jiahuang
jiahuang / watchdog.c
Created Nov 30, 2012
ATTiny watchdog setting
View watchdog.c
uint8_t watchdog_count = 0;
ISR(WDT_vect) {
// This vector is for the watchdog timer
PORTA = PORTA | (1 << LED ); // The LED never goes on
++watchdog_count;
}
ISR(PCINT0_vect)
{
@statico
statico / gist:3172711
Created Jul 24, 2012
How to use a PS3 controller on Mac OS X 10.7 (Lion)
View gist:3172711

How to use a PS3 controller on Mac OS X 10.7 (Lion)

  1. Open Apple menu -> System Preferences -> Bluetooth and disable Bluetooth on Mac as well as any other nearby Macs or devices which will try to pair with and confuse the controller.

  2. Reset PS3 controller by inserting paperclip into pinhole near L2 button.

  3. Connect PS3 controller to Mac with USB cable.

  4. Enable Bluetooth.

@isaacs
isaacs / .gitconfig
Created Jun 8, 2012
These are my shortcuts for git.
View .gitconfig
# A bunch of the stuff above relies on this, especially the aliases.
[user]
# you probably want to change this bit.
name = isaacs
email = i@izs.me
signingkey = 0x6C481CF6
[alias]
ci = commit
st = status
br = branch
@substack
substack / modules.markdown
Created Jun 4, 2012
modules instructional
View modules.markdown

modules instructional

problems

These are just sample ideas. You can come up with something yourself, just make sure you can get it working in ~30 minutes.

  • lcm, gcd
@Raynos
Raynos / x.md
Created Jan 23, 2012
unshimmable subset of ES5
View x.md

The following features of ES5 cannot be shimmed.

The ones you care about

Enumerable properties [ES3]

Using Object.defineProperty if you define a non-enumerable property on an object then for..in loops over that object will behave correctly in modern browsers but enumerate over that property in legacy browsers.

This means that code that works in modern browsers, breaks in legacy browsers.

@Raynos
Raynos / weak-map.js
Last active Sep 18, 2019 — forked from Gozala/weak-map.js
Harmony WeakMap shim for ES5
View weak-map.js
// Original - @Gozola. This is a reimplemented version (with a few bug fixes).
window.WeakMap = window.WeakMap || (function () {
var privates = Name()
return {
get: function (key, fallback) {
var store = privates(key)
return store.hasOwnProperty("value") ?
store.value : fallback
},
You can’t perform that action at this time.