Skip to content

Instantly share code, notes, and snippets.

> c_cyan=`tput setaf 6`
> c_red=`tput setaf 1`
> c_green=`tput setaf 2`
> c_sgr0=`tput sgr0`
>
> parse_git_branch ()
> {
> if git rev-parse --git-dir >/dev/null 2>&1
> then
> gitver=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')
@keedi
keedi / md5.pl
Created June 2, 2011 09:48
like md5sum utility ;-)
#!/usr/bin/env perl
use 5.010;
use utf8;
use strict;
use warnings;
use Digest::MD5;
use File::Slurp;
say sprintf('%s %s', digest($_), $_) for @ARGV;
#! /bin/sh
# This script starts a new shell and sets all enviroment variables, which
# are necessary for building the examples of the Office Development Kit.
# The Script was developed for the operating systems Solaris, Linux and MacOS.
# The SDK name
OO_SDK_NAME=openoffice.org3.2_sdk
export OO_SDK_NAME
@keedi
keedi / upload.pl
Created June 23, 2011 14:18
uploader for sacrobat :-)
#!/usr/bin/env perl
use 5.010;
use utf8;
use strict;
use warnings;
use autodie;
use Getopt::Long::Descriptive;
use Const::Fast;
use LWP;
# git
function git_branch_color {
status=$( git diff --shortstat 2>/dev/null )
if [ "x$status" != 'x' ]; then
color=$( git config color.status.changed )
else
color=$( git config color.branch.current )
fi
echo -ne $color
}
@keedi
keedi / jaker.pl
Created July 20, 2011 18:43
I don't think javascript-like approach is not a good perl-way but @jaker wants. so just code it...
#!/usr/bin/env perl
use 5.010;
use utf8;
use strict;
use warnings;
use autodie;
my $j = do {
package MyJObject;
@keedi
keedi / jaker-anony.pl
Created July 20, 2011 19:40
anonymous package name version. I don't think javascript-like approach is not a good perl-way but @jaker wants. so just code it...
#!/usr/bin/env perl
use 5.010;
use utf8;
use strict;
use warnings;
use autodie;
use UUID::Tiny;
my $j = do {
@keedi
keedi / translate.pl
Created July 27, 2011 07:51
translate.pl
#!/usr/bin/env perl
use common::sense;
use Lingua::Translate;
use Text::WrapI18N qw(wrap);
use FindBin qw($Script);
binmode STDIN, ":utf8";
Lingua::Translate::config(
@keedi
keedi / perlbrew-local-lib.patch
Created August 5, 2011 14:23
perlbrew local lib patch
--- a/perlbrew 2011-08-05 22:18:19.065215002 +0900
+++ b/perlbrew 2011-08-05 23:03:28.513215002 +0900
@@ -7,6 +7,7 @@
use Getopt::Long ();
use File::Spec::Functions qw( catfile );
use FindBin;
+use Config;
our $VERSION = "0.27";
our $CONF;
TheSchwartz::work_once found no jobs [1302/1834]
TheSchwartz::work_once found no jobs
TheSchwartz::work_once got job of class 'Sacrobat::TheSchwartz::Worker::ODT2PDF'
Working on Sacrobat::TheSchwartz::Worker::ODT2PDF ...
2011/09/06 19:16:02 DEBUG Sacrobat::TheSchwartz::Worker::ODT2PDF loading database
2011/09/06 19:16:02 DEBUG Sacrobat::TheSchwartz::Worker::ODT2PDF converting /home/askdna/workspace/silex/github/Sacrobat/upload/2011-09-06/silex/odt/
3858c30c-d871-11e0-b979-8e423411664b-4-9-24.odt
2011/09/06 19:16:02 DEBUG Sacrobat::TheSchwartz::Worker::ODT2PDF connecting to openoffice
2011/09/06 19:16:02 INFO Sacrobat::TheSchwartz::Worker::ODT2PDF convert odt to pdf: /home/askdna/workspace/silex/github/Sacrobat/upload/2011-09-06/si
lex/odt/3858c30c-d871-11e0-b979-8e423411664b-4-9-24.odt