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:

# 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
<?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 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 / 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 / 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()