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
<script type="text/javascript"> | |
// This is a workaround for using jquery-validation-engine with select2 for 'required' validation | |
// Since the _required validator for jquery-validation-engine uses .val() to see | |
// if there's anything in the input, we can hijack .val() for the container created by select2\ | |
// and redirect it to the value of the hidden element | |
// jquery-validation-engine throws an error if the thing we're validating doesn't have an id | |
// so we'll put one on the container created by select2 (that way, the positioning of the prompts | |
// will be correct) | |
$('#mySelector').select2('container').attr('id', 'mySelectorValidate'); |
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
use v5.10; | |
use strict; | |
use warnings; | |
system(1, $^X, '-e', 'sleep 5; print qq[not ok 1 - blah blah\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
use DDP; | |
use Win32::DriveInfo; | |
for my $func (qw(DriveType VolumeInfo)) { | |
for my $drv (qw(a c)) { | |
$res{$func . "-" . $drv} = [ Win32::DriveInfo->can($func)->($drv) ]; | |
} | |
} | |
$res{GetVersionEx} = Win32::DriveInfo::GetVersionEx(); | |
p(%res); |
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
sub hash_password { | |
my ($self, $plain_text, $settings_str) = @_; | |
return Crypt::Eksblowfish::Bcrypt::bcrypt($plain_text, $settings_str) if $settings_str; | |
my $salt = join '', map { chr int rand(256) } 1 .. 16; | |
my %settings = (key_nul => 1, cost => 10, salt => $salt); | |
return Crypt::Eksblowfish::Bcrypt::bcrypt_hash(\%settings, $password); | |
} |
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
(defun remove* (symbol tree) | |
"Removes SYMB0L from TREE." | |
(cond | |
((null tree) | |
tree) | |
((atom (car tree)) | |
(if | |
(equalp symbol (car tree)) | |
(remove* symbol (cdr tree)) | |
(cons (car tree) (remove* symbol (cdr tree))))) |
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
13-03-08@21:19:28 (jdb) http://paste.stacka.to/gejavoyifo.pl | |
13-03-08@21:19:51 (jdb) This is the script that is called to build libxml on the PPM builders. | |
13-03-08@21:20:33 (jdb) It assumes the tarball is already unpacked and the CWD is the top-level directory inside the tarball | |
13-03-08@21:21:19 (jdb) http://paste.stacka.to/furanimeli.avrasm | |
13-03-08@21:21:31 (jdb) This is the "control file" | |
13-03-08@21:24:58 (Mithaldu) can you give me links for the iconv sources you use? | |
13-03-08@21:25:34 (jdb) https://code.google.com/p/win-iconv/ | |
13-03-08@21:26:05 (Mithaldu) and zlib? | |
13-03-08@21:26:33 (jdb) http://paste.stacka.to/guhelixuwo.pl | |
13-03-08@21:27:04 (jdb) http://zlib.net/zlib-1.2.5.tar.gz |
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
Introduction | |
Why Perl over Powershell? | |
Quickstart # portable strawberry, install a module from cpan, run a oneliner | |
Perl distributions for Windows | |
ActivePerl | |
Strawberry Perl | |
Cava # never seen anyone use this | |
cygwin (only briefly) |
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/env perl | |
use strict; | |
use warnings; | |
use URI; | |
use URI::Escape; | |
use Digest::SHA qw(hmac_sha256_base64); | |
use LWP::UserAgent; | |
use XML::LibXML; |
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
use strict; | |
use warnings; | |
use Alien::Base::ModuleBuild; | |
my $builder = Alien::Base::ModuleBuild->new( | |
module_name => 'Alien::GSL', | |
dist_abstract => 'Easy installation of the GNU Scientific Library', | |
license => 'perl', | |
configure_requires => { |