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:

View timelapse
# convert images from source to create buffer frames for blending
convert -verbose flickrcam/*jpg -delay 10 -morph 10 flickranim/%05d.morph.jpg
# run through ffmpeg to combine/transcode to mp4
ffmpeg -r 25 -i flickranim/%05d.morph.jpg flickranim/output.mp4
View get flickr user images
<?php
// download all flickr images from a given userid
// userid is embedded in this url
$key = "enterkeyhere";
$url = "https://api.flickr.com/services/rest/?method=flickr.people.getPhotos&api_key=".$key."&user_id=120759744%40N07&per_page=80&page=";
$append = "&format=json&nojsoncallback=1";
for($i=1; $i<4; $i++){ // 3 pages of 80 images
$uri = $url.$i.$append;
@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 / 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 / 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()