Skip to content

Instantly share code, notes, and snippets.

View codycodes's full-sized avatar

Cody Gagnon codycodes

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
@ruucm-working
ruucm-working / Instruction.md
Last active August 17, 2017 20:28
iTerm2 entire window black Setting (Nightly Version)

1. Get Nightly Version of iTerm 2 (Link)

2. Follow this instruction to get rid of line under the title bar (Link)

3. Change colors at your [Preference - Profiles - Colors] or add themes

4. Change iTerm 2 Application icon using 'iterm-icon' file and follow this instruction (Link)

@evnm
evnm / brew-install-missing-unix-tools
Created October 24, 2011 05:27
A brew command to install useful tools missing from Mac OS X
# Legitimately-useful utilities missing from OS X.
brew install wget watch gnu-sed coreutils
# Up-to-date versions of included tools.
brew install git emacs
# Just for fun.
brew install fortune cowsay
@stuartleeks
stuartleeks / AzureHelpers.ps1
Created November 25, 2015 13:47
A set of functions/cmdlets to simplify working with the Azure PowerShell cmdlets
<#
# Helper function for other cmdlets
#>
function ParseOperationDuration($durationString){
# expected behaviour (should put in tests)
#(ParseOperationDuration "PT21.501S").ToString() # Timespan: 21.501 seconds
#(ParseOperationDuration "PT5M21.501S").ToString() # Timespan: 5 minutes 21.501 seconds
#(ParseOperationDuration "PT1H5M21.501S").ToString() # Timespan: 1 hour 5 minutes 21.501 seconds
#(ParseOperationDuration "PT 21.501S").ToString() # throws exception for unhandled format
@kaushalp
kaushalp / httpsRedirectRule.xml
Created May 8, 2017 14:26
URL Rewrite rule to redirect from HTTP to HTTPS
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="HTTP/S to HTTPS Redirect" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{SERVER_PORT_SECURE}" pattern="^0$" />
</conditions>
@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
@jldeen
jldeen / kube-deploy-sp.parameters.json
Created February 16, 2018 21:19
AKS Service Principal Parameters
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"dnsNamePrefix": {
"value": "<your value>"
},
"sshRSAPublicKey": {
"value": "<your value>"
},
@nateswart
nateswart / flagged_email_to_reminders.scpt
Last active April 2, 2020 22:43
Create Reminders tasks from flagged emails in Mail.app on OSX Mavericks using Gmail accounts.
#!/usr/bin/osascript
on run
-- This script is designed to work with Gmail and OSX Mavericks
-- Make sure Mail.app is actually running
if not (application "Mail" is running) then
return
end if
@hepcat72
hepcat72 / completion_notifier.scpt
Last active April 2, 2020 22:46
Applescript to post webhooks triggered by newly completed iOS reminders in specific list(s)
--Look for newly completed reminders (since the last check) and if there is a new one, make a webhook post with date, title, and list JSON values
--by Robert W. Leach, based on scripts by Craig Eley, Samantha Hilton, and Nick Morris
--This is not foolproof. If you have more than 1 device you use to "complete" reminders and a reminder is completed while offline, after which, a reminder is completed from a second online device, the completion of the reminders in the offline device (once it comes online) will be missed. However, it's done this way so that the script doesn't take forever looking at all reminders each time.
--Schedule it to run as frequently as you would like using osascript in a cron job and forget about it. Run once manually in order to "allow" this script to run in the security settings by responding to the resulting dialog.
--Cron job every 30 minutes looking for newly completed reminders in list "MyReminders" example (execute `crontab -e` in terminal and enter): */30 * * * * osascript /Us

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: