Skip to content

Instantly share code, notes, and snippets.

View jonmagic's full-sized avatar

Jonathan Hoyt jonmagic

View GitHub Profile
window.onload=function(){
d3.select("#frame").on("mousemove", marker);
var canvas = d3.select("#canvas")
function marker()
{
var arrow = d3.mouse(this);
canvas.append("circle")
#!/Library/RubyMotion/bin/ruby -wKUW0
# if your using MacRuby you might change this to
# => #!/usr/bin/env macruby -wKUW0
framework 'Foundation'
framework 'ScriptingBridge'
# the original is part of an arstechnica article by Ryan
# SOURCE: http://arstechnica.com/apple/2011/09/tutorial-os-x-automation-with-macruby-and-the-scripting-bridge/
# this script with get your favourite songs and create a Evernote Note # German and English
@jonmagic
jonmagic / hack-day-12-31-2013.md
Created January 1, 2014 01:45
Had some fun hacking on an Imp and Arduino Yun today.

Hack day (12-31-2013)

My goals for today are to get both devices (imp and yun) connected to the WIFI and then start testing sensors.

Connecting to the WIFI

Imp

I just followed these directions making sure to cover the top of the Imp with my finger so light didn't leak while doing the BlinkUp process. Super simple and just worked.

foooasdffdsa
/*\
|*|
|*| :: cookies.js ::
|*|
|*| A complete cookies reader/writer framework with full unicode support.
|*|
|*| https://developer.mozilla.org/en-US/docs/DOM/document.cookie
|*|
|*| This framework is released under the GNU Public License, version 3 or later.
|*| http://www.gnu.org/licenses/gpl-3.0-standalone.html
class ApplicationController < ActionController::Base
include SessionAuthentication
# ...
end
@jonmagic
jonmagic / email.rb
Last active December 20, 2022 17:17
A handy Rails model for storing emails with a little logic to let a User have multiple email addresses but a single primary address.
class Email < ActiveRecord::Base
# Nope, it's not RFC compliant. F*** that regex.
# http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html
EmailRegex = /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i.freeze
before_validation :strip_spaces
# Public: The email address.
# column :address

Keybase proof

I hereby claim:

  • I am jonmagic on github.
  • I am jonmagic (https://keybase.io/jonmagic) on keybase.
  • I have a public key whose fingerprint is 803A EE9B 6F2C DC04 7FCF B59C A6BE 6D15 DF67 5762

To claim this, I am signing this object:

@jonmagic
jonmagic / gist:10012852
Last active August 29, 2015 13:58
How to sign out of Gmail.
1. Click on the little picture or icon in the upper right and click "Sign out”.
2. Then on the next screen click "Sign in with a different account”.
3. Click “Remove”
4. Click the X next to the account you want to sign out of.
5. Click “Done”
6. Congratulations now you are signed out.