Skip to content

Instantly share code, notes, and snippets.

Avatar

Felipe Knorr Kuhn knorrium

View GitHub Profile
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;
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 colirio.rb
#Para instalar as bibliotecas no Ubuntu, caso alguma falte:
# sudo apt-get install ruby1.8-dev
# sudo apt-get install libopenssl-ruby
# sudo apt-get install libxml2-dev
# sudo apt-get install libxslt-dev
# sudo gem install mechanize
require "rubygems"
require "mechanize"
View seleniumTableExample.java
//this demo uses http://www.cheltladiescollege.org/college/exams.asp
//to try to help @dckismet extracting cell text
package demo;
import org.testng.annotations.Test;
import common.BaseTest;
public class tables extends BaseTest {
View Wordpress.java
import com.thoughtworks.selenium.*;
import java.util.regex.Pattern;
public class Wordpress extends SeleneseTestCase {
public void setUp() throws Exception {
setUp("http://demo.opensourcecms.com/", "*chrome");
}
public void testJunit() throws Exception {
selenium.open("/wordpress/wp-login.php");
selenium.type("user_login", "admin");
View IntegrationInterceptor.java
package common;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.xml.parsers.ParserConfigurationException;
@knorrium
knorrium / following.rb
Created Nov 26, 2010
Lists all the people you are following
View following.rb
require 'rubygems'
require 'twitter'
Twitter.configure do |config|
config.consumer_key = ""
config.consumer_secret = ""
config.oauth_token = ""
config.oauth_token_secret = ""
end
@knorrium
knorrium / fileloop.sh
Created Feb 15, 2011
[BASH] Processes every file in the directory
View fileloop.sh
for i in *ext ; do command "$i" ; done
@knorrium
knorrium / focus_test.py
Created Apr 26, 2012
WebDriver Element focus test
View focus_test.py
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("http://dev.knorrium.info/wd/focus_test.html")
driver.find_element_by_id("btnFocus").click()
element = driver.find_element_by_id("myAnchor")
focused_element = driver.switch_to_active_element()
@knorrium
knorrium / bootstrap.sh
Created Jun 2, 2012 — forked from zspencer/bootstrap.sh
Bootstrapping like a boss
View bootstrap.sh
#symlink gcc to a non-llvm version installed xCode's CLI tools
if [ -f /usr/bin/gcc-4.2 ]; then
sudo rm /usr/bin/gcc
sudo ln -s /usr/bin/gcc-4.2 /usr/bin/gcc
sudo rm /usr/bin/cc
sudo ln -s /usr/bin/gcc-4.2 /usr/bin/cc
fi