This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
binmode(STDIN, 'utf8'); | |
binmode(STDOUT, 'utf8'); | |
sub smart_lowercase($) | |
{ | |
my $word = shift; | |
return $word if (length($word) > 1 and uc($word) eq $word); | |
return lc $word; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use Unicode::UCD 'charinfo'; | |
use Unicode::Normalize 'isNonStDecomp', 'NFD', 'NFC', 'isComp2nd', 'isNonStDecomp'; | |
use charnames ':full'; | |
use Encode; | |
use HTML::Entities; | |
#use Getopt::Std; | |
#our ($opt_f, $opt_r); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
my @w; | |
while (<STDIN>) { chomp; while (split /[^-\w]+/) { push @w, lc $_; } } | |
my $c = {}; | |
while (@w) { $c->{$_} += 1; } | |
my @k = reverse sort { $c->{$a} <=> $c{$b} } keys %{$c}; | |
while (@k) { print $c->{$k}, $k, "\n"; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
my @w; | |
my $sw = {}; | |
while (<DATA>) { print $_; chomp; $sw->{$_} = 1; last; } | |
close DATA; | |
while (<STDIN>) { chomp; while (split /[^-\w]+/) { $_ = lc $_; if (!$sw->{$_}) { push @w, $_; } } } | |
my $c = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -x | |
git clone git@github.com:holgerd77/django-dynamic-scraper.git | |
cd django-dynamic-scraper | |
virtualenv -p python2.7 env | |
source env/bin/activate | |
pip install celery==2.4.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import memcache | |
import hashlib | |
client = None | |
def getClient() : | |
global client | |
if not client : | |
client = memcache.Client(['127.0.0.1:11211'], debug=0) | |
return client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MARC::File::HUNMARC; | |
=head1 NAME | |
MARC::File::HUNMARC - HUNMARC-specific file handling | |
=cut | |
use strict; | |
use integer; |