Skip to content

Instantly share code, notes, and snippets.

View danielwestendorf's full-sized avatar
:shipit:
shipping

Daniel Westendorf danielwestendorf

:shipit:
shipping
View GitHub Profile
jQuery entered into this app on commit 1cfb2f8, living a long, fruitful life until it's timely demise with commit f577d54. It is survived by it's only child, jqLite.
While jQuery may not have been loved in the end, it was once a savior for web devs throughout the world. Browser bugs, animations, and reusable client side code became a quick convenience, thanks to the jQuery. Plug-ins became plentiful; no one had to write code for yet another image slider. It provided an easy entryway into the world of front end dev for many of us backend neck beards. Times were good.
But like most things, they either die a hero, or live long enough to become the enemy.
Dollar signs became all too plentiful in the land of the Hyper Transfer Text Protocol. Soon, everyone was writing front end code, abusing plugins, and making bad choices. Cross browser bugs became a thing of the past; the landscape began to change, but the developer was no more so educated. All that was known was dollar sign selectors, Javascript based animat
@danielwestendorf
danielwestendorf / notify.rb
Last active February 4, 2018 16:03
Need to be notified of something immediately via telephone? Twilio/AWS/Ruby mashup to do just that
require 'twilio-ruby'
require 'aws'
# Creates a phone call using the Twilio and AWS SDK's that uses text-to-speech to play a message
# Expected to be called from the command line with the respective arguments
# Creates an XML document that is uploaded to S3. This XML document tells Twilio what to do once the call is connected
# pass your Twilio creds via environmental variables
twilio_sid = ENV['TWILIO_SID']
twilio_token = ENV['TWILIO_TOKEN']
@danielwestendorf
danielwestendorf / index.html
Last active December 10, 2015 14:19
Obtain the dominant colors in an image that are drastically different than each other using client side HTML and JS. A la iTunes 11 Albums view.
<!DOCTYPE html>
<html>
<head>
<title>Dominant Color</title>
<style type="text/css">
html, body {
font-family: Gotham, Helvetica, Arial, sans-serif;
width: 100%;
height: 100%;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMYAAADICAAAAACW+sHxAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wL
@danielwestendorf
danielwestendorf / MRNotificaiton.rb
Created December 8, 2011 22:25
Desktop Notifications for MacRuby
#
# MRNotification.rb
#
# Created by Daniel Westendorf on 12/8/11.
# MIT Licensed, use as you wish as-is.
framework 'Cocoa'
class MRNotifier
@danielwestendorf
danielwestendorf / gist:1370277
Created November 16, 2011 15:06
Iterate over an NSIndexSet with .each
class NSIndexSet
def each
i = lastIndex
while i != NSNotFound
yield i
i = indexLessThanIndex(i)
end
end
include Enumerable
@danielwestendorf
danielwestendorf / gist:1219973
Created September 15, 2011 17:59
Printer Magic VBScript
On Error Resume Next
'Save as a file with the .vbs extension such as printerConversion.vbs
'Script written by Daniel Westendorf - daniel at prowestech dot com. It is provided to be used and minipulated at
'will, but with any expressed warranty as to what it will or will not do. No support is provided with this script.
'Usage:
'Save as a file with the .vbs extension such as printerConversion.vbs
'Replace PATHTTOPRINTERMAPPINGCSVFILE with the real path to your mapping file. It should be in a location accessible
'by any machine such as \\domanNAME\NETLOGON
@danielwestendorf
danielwestendorf / gist:1219965
Created September 15, 2011 17:56
csv print queue mapping
\\printserver1\acnt_prntr_1,\\printserver1\AccountingPrinterPCL5
\\printserver1\acnt_prntr_2,\\printserver1\AccountingPrinterPCL5
\\printserver1\acnt_prntr_3,\\printserver1\AccountingPrinterPCL5
url = NSURL.URLWithString "macappstore://itunes.apple.com/us/app/thumper/id436422990?mt=12ls=1ign-msr=http%3A%2F%2Fwww.thumperapp.com%2F"
NSWorkspace.sharedWorkspace.openURL(url)
attr_accessor @main_window, @my_modal_window, @modal_submit_button,
@modal_cancel_button, @modal_value_text_field, @modal_load_default_button
my_modal = SimpleModal.new(@main_window, @my_modal_window) #create the SimpleModal object.
#It expects 2 arguments. The first being the window you're
#going to add the modal to, and the second being the modal
#window you want to add
#now lets add some outlet actions for the modal.
class SimpleModal
attr_accessor :window, :modal, :outlets
def initialize(window, modal)
@window = window
@modal = modal
@outlets = []
end