Skip to content

Instantly share code, notes, and snippets.

View codycodes's full-sized avatar
😀

Cody Gagnon codycodes

😀
  • Oshkosh Corporation
  • Seattle, WA
  • 18:58 (UTC -07:00)
View GitHub Profile
@dannysmith
dannysmith / osx_setup.sh
Last active April 16, 2025 00:12
Sensible defaults for New Mac
#!/usr/bin/env bash
# ~/.osx — http://mths.be/osx
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
@ebouchut
ebouchut / disable_postgres_autostart_on_macos
Created April 16, 2014 08:42
Disable Postgres (installed with Homebrew) autostart on MacOS
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
@miguelgrinberg
miguelgrinberg / pycon-views.py
Last active September 18, 2022 05:41
Generate statistics about PyCon 2014 videos
import argparse
import re
from multiprocessing.pool import ThreadPool as Pool
import requests
import bs4
root_url = 'http://pyvideo.org'
index_url = root_url + '/category/50/pycon-us-2014'
@chilcote
chilcote / gist:f5af1a788ac4a2e4d5df
Created September 2, 2014 03:49
python script to set dns servers and search domains in os x
#!/usr/bin/env python
'''
This script sets dns servers and search domains for all
Ethernet adapters and Wi-fi interfaces.
Requirements
------------
+ OS X 10.9.x
+ python 2.7
@eliangcs
eliangcs / pyenv+virtualenv.md
Last active August 15, 2024 15:17
Cheatsheet: pyenv, virtualenvwrapper, and pip

Cheatsheet: pyenv, virtualenvwrapper, and pip

Installation (for Mac OS)

Install pyenv with brew

brew update
brew install pyenv
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active March 24, 2025 20:20
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@jsomers
jsomers / a-wotd-custom-word-list.md
Last active September 20, 2024 09:17
How to use a custom word list with OS X's "Word of the Day" screensaver

OS X's "Word of the Day" screensaver is a great way to passively learn words:

But I've always thought that its word list kind of stunk—it was full of obscure words that I could never really see myself using. I'd prefer something like Norman Schur's 1000 Most Important Words. What if you could plug your own word list into the screensaver?

On a rather obscure comment thread, someone explained where you might find the word list that Apple uses to power the screensaver. It is at /System/Library/Graphics/Quartz\ Composer\ Plug-Ins/WOTD.plugin/Contents/Resources/NOAD_wotd_list.txt. The file looks like this:

m_en_us1282510	quinsy
@mutewinter
mutewinter / Bluetooth Device Toggle.md
Created September 1, 2015 19:40
An Alfred workflow to toggle the connection to Bluetooth Devices by name.

Workflow icon Bluetooth Device Toggle

Alfred Workflow to toggle bluetooth devices. I use this workflow to toggle the connection to my Bluetooth Headphones.

Download Bluetooth Device Toggle

@etes
etes / pi_mount_usb.md
Last active March 5, 2025 01:30
How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

How to setup mount / auto-mount USB Hard Drive on Raspberry Pi

Follow the simple steps in the order mentioned below to have your USB drive mounted on your Raspberry Pi every time you boot it.

These steps are required especially if your are setting up a Samba share, or a 24x7 torrent downloader, or alike where your Raspberry Pi must have your external storage already mounted and ready for access by the services / daemons.

Step 0. Plug in your USB HDD / Drive to Raspberry Pi If you are using a NTFS formatted drive, install the following

@squarism
squarism / iterm2.md
Last active April 17, 2025 20:55
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)