Skip to content

Instantly share code, notes, and snippets.

Avatar

Felipe Knorr Kuhn knorrium

View GitHub Profile
View keybase.md

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 — forked from bergie/.gitignore
Node.js email handling examples
View .gitignore
config.json
reading-image.png
@knorrium
knorrium / gist:4600977
Created Jan 23, 2013
Padrino admin with dropdown lists
View gist:4600977
# 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 Dec 11, 2013
ios-driver ruby example
View ios-driver.rb
require "selenium-webdriver"
require "pry-nav"
def desired_caps
{
'version' => '7.0',
'device' => 'iphone',
'language' => 'en',
'CFBundleName' => 'Safari',
}
View bootstrap_plugin.rb
# 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')
View iOS7_locales.txt
af
af_NA
af_ZA
agq
agq_CM
ak
ak_GH
am
am_ET
ar
View ioslocaleidentifiers.csv
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)
View gist:4715908
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 Sep 20, 2012
Taking screenshots with remote webdriver using the Python bindings
View screenshot.py
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 Jul 23, 2012 — forked from kingbin/polldaddy_v2.rb
automate testing a web project :)
View polldaddy_v2.rb
# 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/'