Skip to content

Instantly share code, notes, and snippets.

View mbierman's full-sized avatar

Michael Bierman mbierman

View GitHub Profile
@mbierman
mbierman / net.sh
Created March 31, 2014 18:10
Get some idea of how network latency is doing.
#!/usr/bin/env bash
#Variables
count=0
max=45
sleept=1
maxsleep=15
domain=www.oracle.com
while [ "$count" -eq 0 ]; do
/* https://en.todoist.com/app?lang=en&v=848#start */
.date_overdue {
color: red;
border: 2px solid red;
padding-left: 20px;
padding-right:20px;
border-radius: 4px;
}
@mbierman
mbierman / soundpicker
Created February 21, 2014 20:06
Make it easy to choose the destination for your audio
--Each of the list corresponds to sound souces like AirPort devices and bluetooth
set asrc to (choose from list {"Internal Speakers", "living room", "girl's bedroom", "master bedroom", "OontZ Curve", "OontZ Curve Stereo", "office"} with title "Sound Picker" default items {"Internal Speakers"}) as text
if result is "false" then return
-- for debugging
-- display dialog "src is: " & asrc
@mbierman
mbierman / getRSS
Last active August 29, 2015 13:56
Gets the RSS feeds from a web page. Can be used in an AppleScript or commandline.
curl --silent $1 | grep 'type="application/rss+xml"'
@mbierman
mbierman / Portrait.svg
Last active August 29, 2015 13:56
SVG Portrait
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
.contact-picture img {
-webkit-border-radius: 15px;
border-radius: 15px;
}
.date_overdue {
color: red;
border: 2px solid red;
padding-left: 20px;
padding-right:20px;
border-radius: 4px;
}
.date_future {
@mbierman
mbierman / getnpr.sh
Last active April 10, 2021 01:49
Fetch NPR shows
#!/bin/bash
# Varibles
OS="$(uname -s | sed -e 's/Darwin/macos/g')"
MUSER=$(echo $USER | tr '[:upper:]' '[:lower:]' | awk '{for (i=1;i<=NF;i++) $i=toupper(substr($i,1,1)) substr($i,2)} 1')
MACH=$(hostname -s)
PATH=$LOCATION:$PATH
UA="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36"
MKDIR="mkdir -p"
LOCATION=$(dirname $0)
@mbierman
mbierman / TurnoffWifiwithDisplayPort
Last active December 20, 2015 10:39
Turn off Wifi if Display Ethernet is plugged in
-- note this assumes your wireless ethernet interface is en1
-- get the correct interface from the menu Apple|About This Mac|Network|Wi-Fi or from terminal using ifconfig -a
-- todo:
-- dynamically set the wifi
--
set makiaeawireedstatus to null
set makiaeawireedstatus to do shell script "networksetup -listallhardwareports"
@mbierman
mbierman / mobile safari.applescript
Last active December 11, 2015 05:59
Open Mobile Safari to a particular URL, set the user agent to iPhone, and center on screen.
-- Sets Safari to iPhone user agent and loads mobile.walmart.comf
set theURL to "http://mobile.walmart.com"
tell application "Safari" to activate
tell application "Safari"
activate
try
tell window 1 to set current tab to make new tab with properties {URL:theURL}
on error
open location theURL