Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
online=false
ping 8.8.8.8 | while read line; do
echo "$line"
if [[ $line == *"bytes from"* ]]; then
if [[ $online = false ]]; then
online=true
afplay ./dial-up.mp3
#!/bin/sh
ping $1 | while read line; do
echo "$line"
if [[ $line == *"bytes from"* ]]; then
echo -ne '\007';
fi
done
#!/bin/zsh
function replace-default-with-profile {
#reads through an aws credentials file,
#takes the contents of the profile give in $1
#and copies those credentials into the default profile
declare profileName=$1
declare fileName=${2:-~/.aws/credentials}
declare profileBody=""
@cbadke
cbadke / Update-AUPackages.md
Last active December 5, 2017 18:43
Update-AUPackages Report #powershell #chocolatey
[user]
name = Curtis Badke
email = curtis@badkid.ca
[diff]
renames = true
[mergetool]
keepBackup = false
[log]
date = relative
@cbadke
cbadke / config-dev-machine.ps1
Last active March 10, 2017 16:49
Scripts to automatically configure a bare-bones Windows dev env. To use: iex ((new-object net.webclient).DownloadString('https://gist.githubusercontent.com/cbadke/85c983e2b99240ab0ef0/raw/config-dev-machine.ps1'))
#install Chocolatey
iex (new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')
#install PsGet
iex (new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1")
Install-Module PSReadLine
cinst githubforwindows -y
cinst gitextensions -y
cinst vim -y
@cbadke
cbadke / .vimrc
Last active April 24, 2017 16:08 — forked from napcs/.vimrc
Set up Vim on Mac, Linux, or Windows. For Mac and Linux: sh <(curl -s https://gist.githubusercontent.com/cbadke/fe5f5e16f0e0da2467d5/raw/vim.sh) For Windows: iex ((new-object net.webclient).DownloadString('https://gist.githubusercontent.com/cbadke/fe5f5e16f0e0da2467d5/raw/vim.ps1'))
" This is the main file that loads up the other configuration files.
if has('win32') || has ('win64')
let $VIMHOME = $HOME."/vimfiles"
else
let $VIMHOME = $HOME."/.vim"
endif
source $VIMHOME/vundle
source $VIMHOME/vimrc_main
____( \ .-' `-. / )____
(____ \_____ / (O O) \ _____/ ____)
(____ `-----( ) )-----' ____)
(____ _____________\ .____. /_____________ ____)
(______/ `-.____.-' \______)
@cbadke
cbadke / keybase.md
Created September 18, 2014 18:02
keybase.md

Keybase proof

I hereby claim:

  • I am cbadke on github.
  • I am cbadke (https://keybase.io/cbadke) on keybase.
  • I have a public key whose fingerprint is C8D0 B5C7 5D9B B3EF 31F9 AC6C 0DDA DBAA 0E79 70EB

To claim this, I am signing this object:

@cbadke
cbadke / gist:5774213
Last active December 18, 2015 11:18
A friend asked for some reading to learn Java...

This probably isn't quite what you're looking for but...

First off I'm not a 'Java Programmer'. But that doesn't matter much. To get into a language, once you have exposure to languages in the 'family' it doesn't take long to gain the ability to bang away at the problem. You won't know the idioms of the language and you probably wont' know the best way to do certain things but you can find your way around.

Java is part of the C family of languages. C/C++/C#/Java and others all come from the same core and have diverged from each other over time.

For Java syntax people seem to like Java - The Good Parts or others. This StackOverflow question seems to have some appropriate discussion.

Beyond that the trick is to learn the underlying principles of programming. That is what will really get you going in the long run (although it takes longer in th