Skip to content

Instantly share code, notes, and snippets.

@satojkovic
satojkovic / txt2csv.pl
Created March 5, 2012 03:41
Replace file extension txt to csv
#!perl
use strict;
use warnings;
use File::Basename;
use File::Spec;
use File::Copy;
my $file = shift;
@satojkovic
satojkovic / github-perl-create.sql
Created May 14, 2012 15:03
Github Data Challenge Example
/* top 100 owners for Perl by number of creates */
SELECT repository_owner, count(repository_owner) as creates
FROM [githubarchive:github.timeline]
WHERE type="CreateEvent"
AND repository_language="Perl"
AND PARSE_UTC_USEC(created_at) >= PARSE_UTC_USEC('2012-05-01 00:00:00')
GROUP BY repository_owner
ORDER BY creates DESC
LIMIT 100
@satojkovic
satojkovic / github-ruby-create.sql
Created May 14, 2012 15:07
Github Data Challenge Example2
/* top 100 owners for Ruby by number of creates */
SELECT repository_owner, count(repository_owner) as creates
FROM [githubarchive:github.timeline]
WHERE type="CreateEvent"
AND repository_language="Ruby"
AND PARSE_UTC_USEC(created_at) >= PARSE_UTC_USEC('2012-05-01 00:00:00')
GROUP BY repository_owner
ORDER BY creates DESC
LIMIT 100
@satojkovic
satojkovic / popular_forked_js.sql
Created May 19, 2012 16:12
Top 50 forked repository for JavaScript
@satojkovic
satojkovic / popular_forked_ruby.sql
Created May 19, 2012 16:25
Top 100 forked repository for Ruby
@satojkovic
satojkovic / popular_forked_python.sql
Created May 19, 2012 16:26
Top 100 forked repository for Python
#!perl
use strict;
use warnings;
use Image::ExifTool qw(:Public);
use Location::GeoTool;
use WebService::Simple;
my $img = shift;
@satojkovic
satojkovic / readdir.pl
Created September 19, 2012 17:03
opendir, readdir test
#!perl
use strict;
use warnings;
my $dir = shift;
if( ! defined($dir) ) { die "Usage: $0 <dir>"; }
opendir my $DIR_H, $dir or die "$dir: $!";
my @dir_entrys = map{ -d $dir ? $_ : "" } readdir $DIR_H;
@satojkovic
satojkovic / instagram_python_api_sample.py
Created October 2, 2012 16:46
instagram python library sample
import bottle
from bottle import route, post, run, request
from instagram import client, subscriptions
bottle.debug(True)
CONFIG = {
'client_id': ''
'client_secret': ''
'redirect_uri': 'http://localhost:8515/oauth_callback'
@satojkovic
satojkovic / instagram_api_ruby_sample.rb
Created October 3, 2012 16:58
instagram ruby library sample
require 'sinatra'
require 'instagram'
require 'pit'
enable :sessions
CALLBACK_URL = "http://localhost:4567/oauth/callback"
Instagram.configure do |config|
conf = Pit.get("api.instagram.com", :require => {