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 -wT | |
# See bottom of file for default license and copyright information | |
package CSVDemo; | |
use strict; | |
use warnings; | |
# Adjust these variables to suit your own data/requirements | |
my $formname = 'System.MigrationScriptsCSVDemo.CSVDemoForm'; | |
my ( $csvtopic, $csvfile ) = |
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 -CSAD | |
# You probably want to run as perl -CSAD /tmp/test.pl | |
# This is a little exploration of http://perldoc.perl.org/perlunicode.html#The-"Unicode-Bug" | |
# See also http://stackoverflow.com/questions/6162484/why-does-modern-perl-avoid-utf-8-by-default | |
use utf8; | |
use warnings; | |
use strict; | |
my $u = 'ü'; |
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 UTF8Tests; | |
use strict; | |
use warnings; | |
# TODO: Exercise | |
# $Foswiki::cfg{Site}{CharSet} | |
# $Foswiki::cfg{UseLocale} | |
# $Foswiki::cfg{Site}{Locale} | |
# $Foswiki::cfg{Site}{Lang} | |
# $Foswiki::cfg{Site}{FullLang} |
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
# See bottom of attachment for default license and copyright information | |
package Foswiki::Contrib::MigrationScriptsContrib::Roles::FoswikiAddressable; | |
use Moose::Role; | |
use Assert; | |
use Foswiki::Func(); | |
use Foswiki::Meta(); | |
use Foswiki::Address(); |
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 CharacterTests; | |
use strict; | |
use warnings; | |
# Using utf8, so we can have interesting chars in the source code. | |
use utf8; | |
use FoswikiFnTestCase; | |
our @ISA = qw( FoswikiFnTestCase ); |
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
var databases = db.adminCommand('listDatabases')['databases']; | |
var count = 0; | |
for (var item in databases) { | |
print(databases[item]['name']); | |
count = count + db.getMongo().getDB(databases[item]['name']).current.count(); | |
} |
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
var databases = db.adminCommand('listDatabases')['databases']; | |
for (var item in databases) { | |
db = db.getMongo().getDB(item['name']); | |
db.current.ensureIndex({_web: 1}); | |
db.current.ensureIndex({_topic: 1}); | |
db.current.ensureIndex({'TOPICINFO.author': 1}); | |
db.current.ensureIndex({'TOPICINFO.date': 1}); | |
db.current.ensureIndex({'CREATEINFO.author': 1}); | |
db.current.ensureIndex({'CREATEINFO.date': 1}); |
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 -wT | |
use warnings; | |
use strict; | |
sub _stashText { | |
my ($fragment, $map, $key) = @_; | |
my $id = $map->{index}; | |
ASSERT(ref($map) eq 'HASH') if DEBUG; |
NewerOlder