Skip to content

Instantly share code, notes, and snippets.

View wchristian's full-sized avatar

Christian Walde (Mithaldu) wchristian

View GitHub Profile
<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');
use v5.10;
use strict;
use warnings;
system(1, $^X, '-e', 'sleep 5; print qq[not ok 1 - blah blah\n]');
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);
@wchristian
wchristian / gist:7083923
Last active December 26, 2015 03:09 — forked from brianmed/gist:7083904
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);
}
@wchristian
wchristian / gist:5908229
Last active December 19, 2015 05:59 — forked from churib/gist:5908179
(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)))))
@wchristian
wchristian / gist:5119725
Created March 8, 2013 20:45 — forked from anonymous/gist:5119721
xml::libxml on windows
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
@wchristian
wchristian / perl_on_windows.txt
Created July 25, 2012 22:07 — forked from briandfoy/perl_on_windows.txt
Outline for a book on Perl on Windows
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)
@wchristian
wchristian / books.pl
Created July 18, 2012 13:36 — forked from vti/books.pl
Books publications
#!/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;
@wchristian
wchristian / FTP-Build.PL
Created January 15, 2012 18:58 — forked from jberger/FTP-Build.PL
Alien::Base with alternative FTP object
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 => {