Skip to content

Instantly share code, notes, and snippets.

View codycodes's full-sized avatar
😀

Cody Gagnon codycodes

😀
  • Oshkosh Corporation
  • Seattle, WA
  • 19:38 (UTC -07:00)
View GitHub Profile
@conorbone
conorbone / .bashrc
Last active March 11, 2017 21:55
.bashrc
# .bashrc
export PS1="\[\e[31m\][\[\e[m\]\[\e[31m\]\u\[\e[m\]@\[\e[31m\]\h\[\e[m\]\[\e[31m\]]\[\e[m\]:\[\e[36m\][\[\e[m\]\[\e[36m\]\w\[\e[m\]\[\e[36m\]]\[\e[m\]\[\e[31m\]\\$\[\e[m\] "
# i like to talk to cows
fortune -c | cowthink -f $(find /usr/share/cows -type f | shuf -n 1)
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo "Hardware Information:"
uptime
free -m
# SSH sesions should be 80 wide :3

How to add an image to a gist

  1. Create a gist if you haven't already.
  2. Clone your gist:
    # make sure to replace `<hash>` with your gist's hash
    git clone https://gist.github.com/<hash>.git # with https
    git clone [email protected]:<hash>.git     # or with ssh
@mihow
mihow / load_dotenv.sh
Last active April 17, 2025 16:08
Load environment variables from dotenv / .env file in Bash
# The initial version
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
# My favorite from the comments. Thanks @richarddewit & others!
set -a && source .env && set +a
@citrusui
citrusui / dropdown.md
Last active April 14, 2025 17:04
"Dropdowns" in Markdown
How do I dropdown?
This is how you dropdown.

<details>
<summary>How do I dropdown?</summary>
<br>
This is how you dropdown.

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@rudelm
rudelm / autofs.md
Last active April 3, 2025 21:48
Use autofs on Mac OS X to mount network shares automatically during access

Autofs on Mac OS X

With autofs you can easily mount network volumes upon first access to the folder where you want to mount the volume. Autofs is available for many OS and is preinstalled on Mac OS X so I show you how I mounted my iTunes library folder using this method.

Prepare autofs to use a separate configuration file

autofs needs to be configured so that it knows where to gets its configuration. Edit the file /etc/auto_master and add the last line:

#
# Automounter master map
#

+auto_master # Use directory service

Automate a reminder to pack your laptop

I don't usually take my work laptop home each evening, but once in awhile I do, and a fraction of those times I've neglected to pack the deck the next morning because it's not part of my usual morning routine.

Here's a quick fix, using iCloud reminders, a neat (free!) app called ControlPlane and a couple of short scripts.

1. Install ControlPlane

Get ControlPlane by using Cask:

@subfuzion
subfuzion / curl.md
Last active April 16, 2025 09:14
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@edupsousa
edupsousa / config.txt
Created January 16, 2016 16:45
RPi2 config.txt with support for 2560x1080 resolution on LG25UM65 display.
# From https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=24679&start=50
hdmi_ignore_cec_init=1
hdmi_drive=2
disable_overscan=1
hdmi_ignore_edid=0xa5000080
hdmi_group=2
hdmi_mode=87
hdmi_timings=2560 1 64 64 96 1080 1 3 10 31 0 0 1 60 0 185580000 8
@oscarmorrison
oscarmorrison / IFTTTDate.md
Last active January 29, 2025 23:07
Make IFTTT Date Format play nice with Google Spreadsheets

##Date and Time

=TIMEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " ")) + DATEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " "))

##Date

=DATEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " "))

##Time