- GitHub Staff
- http://jonmagic.com/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pp' | |
require 'rubygems' | |
require 'mongo_mapper' | |
require 'benchmark' | |
MongoMapper.database = 'testing' | |
class Foo | |
include MongoMapper::Document | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$> 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********************************** | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "benchmark" | |
require "delegate" | |
require "forwardable" | |
class Person | |
def initialize(name, ip) | |
@name = name | |
@ip = ip | |
end |