Skip to content

Instantly share code, notes, and snippets.

View jonmagic's full-sized avatar

Jonathan Hoyt jonmagic

View GitHub Profile
/*\
|*|
|*| :: 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
foooasdffdsa
@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.

#!/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 / bg.js
Last active December 14, 2015 11:28
window.onload=function(){
d3.select("#frame").on("mousemove", marker);
var canvas = d3.select("#canvas")
function marker()
{
var arrow = d3.mouse(this);
canvas.append("circle")
# Rails CVE-2013-0156 IRB Shell PoC
#
# Adapted from
# https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/http/rails_xml_yaml_code_exec.rb
# http://ronin-ruby.github.com/blog/2013/01/09/rails-pocs.html
# http://blog.codeclimate.com/blog/2013/01/10/rails-remote-code-execution-vulnerability-explained/
#
require "net/https"
require 'uri'
@jonmagic
jonmagic / gist:3838029
Created October 5, 2012 04:09
Crazy helpful rake tasks for understanding what indexes to use in MongoDB (extracted from a Rails app at GitHub).
# If you are using in a Rails app just add gem 'plucky' to Gemfile.
# Otherwise install the plucky gem and require it.
# require 'plucky'
#
# Halp.mongo_db is just a shortcut to the database I already connected
# to using the mongo ruby driver.
#
# http://api.mongodb.org/ruby/current/file.TUTORIAL.html has instructions
# for the mongo ruby driver.
class Discussion
States = {
:new => 0,
:open => 1,
:closed => 2,
}
end