Skip to content

Instantly share code, notes, and snippets.

View hrpunio's full-sized avatar

tomasz przechlewski hrpunio

View GitHub Profile
library("ggplot2")
library("ggpubr") ## for ggarrange
library("dplyr")
df <- data.frame(
ab = c(10, 10, 10, 20, 15, 20),
as = c(12, 15, 18, 18, 12, 30),
branch = c('S', 'M', 'D', 'CS', 'IT', 'A')
)
@hrpunio
hrpunio / picasaweb2.pl
Last active August 29, 2015 14:25
Upload file | Upload file with metadata | Create album | List albums @ picasaweb via API
#!/usr/bin/perl
#
# *** Upload file | Upload file with metadata | Create album | List albums @ picasaweb via API ***
#
# Examples of usage
# Note: if option --printonly is present NO real action is performed
# ONLY http message is verbatim printed on STDOUT (useful in case of problems)
# -----------------
# Upload with metadata:
# picasaweb.pl -xload -title Komorowski -descr 'Komorowski w czapce' -keywords 'komorowski,prezydent' -file BK_w_czapce.jpg -album 12345
@hrpunio
hrpunio / picassa_album_create.sh
Created July 18, 2015 14:11
Create album @ picasaweb
#!/bin/bash
ALBUM_TITLE="$1" # Album title
ALBUM_DESCR="$2" # Album description
Album_Keywords="$3" # Album keywords (comma separated)
ACCESS_TOKEN=$(oauth2picasa.py) ## Acces token is managed with Python's script now
MESSAGE="<entry xmlns='http://www.w3.org/2005/Atom'
xmlns:media='http://search.yahoo.com/mrss/'
xmlns:gphoto='http://schemas.google.com/photos/2007'>
@hrpunio
hrpunio / picasaweb.pl
Created July 12, 2015 16:35
Upload file, create album and list albums @ picasaweb via API
#!/usr/bin/perl
# *** Upload file | Create album | List albums @ picasaweb via API ***
use strict;
use LWP::UserAgent;
use Getopt::Long;
use File::MimeInfo;
use XML::LibXML;
use open ':std', ':encoding(UTF-8)';
my $profileID="default";
@hrpunio
hrpunio / blogger_upload.pl
Created July 8, 2015 15:25
Upload post to blogger with Perl/Python (OAuth 2.0 authorozation)
#!/usr/bin/perl
# *** Wyslanie posta na blogger.com ***
use strict;
use LWP::UserAgent;
use XML::LibXML;
use Getopt::Long;
my $profileID="default";
my $blogID = '1928418645181504144'; # Identyfikator bloga
my $blog_entry ;
@hrpunio
hrpunio / oauth2picasa.py
Created June 22, 2015 09:59
OAuth 2.0 authorization borrowed from https://github.com/leocrawford/picasawebsync
#!/usr/bin/python
import os
import time
import httplib2
## https://github.com/google/oauth2client
## installed with pip install --upgrade oauth2client (or some other way)
from oauth2client import client
def oauthLogin():
#!/bin/bash
MY_PIC="$1" ## filename of the picture to upload ##
ALBUM_ID=6008849823888405298 # ID of picasaweb album
PIC_TITLE=`basename $MY_PIC` # filename w/o extension
PIC_TYPE=`file -b --mime-type "$MY_PIC"`
ACCESS_TOKEN=$(oauth2picasa.py) ## Acces token is managed with Python's script now
## Note that ALBUM_XML URL starts now from https:// now
ALBUM_XML="https://picasaweb.google.com/data/feed/api/user/$USER_ID/albumid/$ALBUM_ID"
#!/usr/bin/perl
# Get content of SET or Pool
#
use Flickr::API;
use Compress::Zlib;
use Getopt::Long;
use XML::DOM;
require 'login2flickr.rc';
@hrpunio
hrpunio / gpx2kml.pl
Created September 11, 2013 13:54
GPX track to KML conversion
#!/usr/bin/perl
#
# GPX track to KML conversion
use Getopt::Long;
my $color="ff0000ff";
my $number_w_sign="[\+\-]?[0-9\.]+";
my $quote_sign="[ \t]*[\"'][ \t]*";
my $segment = '';
my $kml_name='??????';
@hrpunio
hrpunio / picasa_upld.sh
Created September 11, 2013 13:52
Upload pic_file to Google photos/Picasa with curl; returns source image URL
#!/bin/bash
# Upload pic_file to Google photos/Picasa with curl; returns source image URL
#
# Usage: picasa.sh -s SCALE -a ALBUMID -t PIC_NAME -u -r pic_file
# -s SCALE -- scale pic_file to SCALE% (with imagemagic's convert)
# -a ALBUMID -- if not given upload to default album
# -t PIC_NAME -- picture name, if not given the same as pic_file
# -u -- print HTML fragment with URL to pic_file
# -r -- remove scaled pic_file
#