Skip to content

Instantly share code, notes, and snippets.

View knorrium's full-sized avatar

Felipe Knorr Kuhn knorrium

View GitHub Profile

Keybase proof

I hereby claim:

  • I am knorrium on github.
  • I am knorrium (https://keybase.io/knorrium) on keybase.
  • I have a public key ASA-kOW0IbkhyhDZJdDgtEWj47CqirxbxWF5-rShlhefxQo

To claim this, I am signing this object:

@knorrium
knorrium / .gitignore
Created May 17, 2012 03:57 — forked from bergie/.gitignore
Node.js email handling examples
config.json
reading-image.png
@knorrium
knorrium / gist:4600977
Created January 23, 2013 01:42
Padrino admin with dropdown lists
# Source: http://mph.puddingbowl.org/2011/04/padrino/
get :new do
@clients = Client.all
@software = SiteSoftware.all
@site = Site.new
render 'sites/new'
end
@knorrium
knorrium / ios-driver.rb
Created December 11, 2013 18:38
ios-driver ruby example
require "selenium-webdriver"
require "pry-nav"
def desired_caps
{
'version' => '7.0',
'device' => 'iphone',
'language' => 'en',
'CFBundleName' => 'Safari',
}
@knorrium
knorrium / bootstrap_plugin.rb
Created September 19, 2013 00:25
test test
# Simple plugin to install Twitter bootstrap.
#
get 'https://raw.github.com/twbs/bootstrap/master/dist/css/bootstrap.css', destination_root('public/stylesheets/bootstrap.css')
# get 'https://raw.github.com/twitter/bootstrap/master/docs/assets/css/bootstrap-responsive.css', destination_root('public/stylesheets/bootstrap-responsive.css')
get 'https://raw.github.com/twbs/bootstrap/master/dist/js/bootstrap.js', destination_root('public/javascripts/bootstrap.js')
get 'https://raw.github.com/twbs/bootstrap/master/dist/js/bootstrap.min.js', destination_root('public/javascripts/bootstrap.min.js')
# get 'https://raw.github.com/twitter/bootstrap/master/docs/assets/img/glyphicons-halflings.png', destination_root('public/images/glyphicons-halflings.png')
# get 'https://raw.github.com/twitter/bootstrap/master/docs/assets/img/glyphicons-halflings-white.png', destination_root('public/images/glyphicons-halflings-white.png')
@knorrium
knorrium / iOS7_locales.txt
Created September 18, 2013 03:50
iOS7 Locales
af
af_NA
af_ZA
agq
agq_CM
ak
ak_GH
am
am_ET
ar
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
namespace :spec do
namespace :units do
desc "Run unit specs with PATTERN in the spec file name"
RSpec::Core::RakeTask.new(:selective => "db:test:prepare") do |t|
t.pattern = FileList["spec/**/*#{ENV['PATTERN']}*_spec.rb"].exclude("spec/integration/**/*_spec.rb")
end
end
namespace :integration do
desc "Run integration specs with PATTERN in the spec file name"
@knorrium
knorrium / screenshot.py
Created September 20, 2012 02:51
Taking screenshots with remote webdriver using the Python bindings
import selenium.webdriver as webdriver
import sys
def visit_page_and_take_screenshot(server, browser, url, filename):
remote = 'http://' + server + ':4444/wd/hub'
caps = { "browserName": browser }
driver = webdriver.Remote(command_executor=remote, desired_capabilities=caps, browser_profile=None)
driver.get(url)
driver.get_screenshot_as_file(filename)
driver.quit()
@knorrium
knorrium / polldaddy_v2.rb
Created July 23, 2012 20:10 — forked from kingbin/polldaddy_v2.rb
automate testing a web project :)
# Using the web automation driver (watir-webdriver) through the tor network
# Automates webpage actions & bypasses the voting limit on polldaddy
# Casts a vote every 3 seconds for a total of 1000 votes
require 'watir-webdriver'
profile = Selenium::WebDriver::Firefox::Profile.new
profile.proxy = Selenium::WebDriver::Proxy.new :http => '127.0.0.1:8118'
b = Watir::Browser.new :firefox, :profile => profile
#b = Watir::Browser.new :firefox
b.goto 'speakimge.wordpress.com/2012/01/25/under-the-covers/'