Skip to content

Instantly share code, notes, and snippets.

View jonmagic's full-sized avatar

Jonathan Hoyt jonmagic

View GitHub Profile
require "benchmark"
require "delegate"
require "forwardable"
class Person
def initialize(name, ip)
@name = name
@ip = ip
end
# List unique values in a DataFrame column
# h/t @makmanalp for the updated syntax!
df['Column Name'].unique()
# Convert Series datatype to numeric (will error if column has non-numeric values)
# h/t @makmanalp
pd.to_numeric(df['Column Name'])
# Convert Series datatype to numeric, changing non-numeric values to NaN
# h/t @makmanalp for the updated syntax!
@jonmagic
jonmagic / Adafruit_GPS.cpp
Created April 21, 2018 05:07 — forked from dmiddlecamp/Adafruit_GPS.cpp
Spark GPS demo with Adafruit Ultimate GPS breakout
/***********************************
This is our GPS library
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, check license.txt for more information
All text above must be included in any redistribution
@jonmagic
jonmagic / install-kafka.txt
Created December 11, 2017 05:59 — forked from jarrad/install-kafka.txt
Install Kafka on OSX via Homebrew
$> brew cask install java
$> brew install kafka
$> vim ~/bin/kafka
# ~/bin/kafka
#!/bin/bash
zkServer start
kafka-server-start.sh /usr/local/etc/kafka/server.properties
#!/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
# 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'
require 'pp'
require 'rubygems'
require 'mongo_mapper'
require 'benchmark'
MongoMapper.database = 'testing'
class Foo
include MongoMapper::Document