Skip to content

Instantly share code, notes, and snippets.

View hexfusion's full-sized avatar
🐀
scampering

Sam Batschelet hexfusion

🐀
scampering
  • Red Hat
  • gRPC stream
View GitHub Profile
#!/bin/bash
PERL_STABLE="5.16.1"
echo '%< --- installing perlbrew ---'
echo
curl -kL http://install.perlbrew.pl | bash
source ~/perl5/perlbrew/etc/bashrc
perlbrew install --notest perl-${PERL_STABLE}
@hexfusion
hexfusion / gist:7319937
Created November 5, 2013 14:36
QODBC-connection.pl
!/usr/local/bin/perl
use strict;
use warnings;
use DBI;
use Crypt::IDEA
my $key= 'mykey';
my $host = "remote.mydomain.com";
@hexfusion
hexfusion / gist:7414283
Created November 11, 2013 14:51
record_is_object.diff
diff --git a/lib/Template/Flute.pm b/lib/Template/Flute.pm
index 816dc90..b52aa5f 100644
--- a/lib/Template/Flute.pm
+++ b/lib/Template/Flute.pm
@@ -3,6 +3,8 @@ package Template::Flute;
use strict;
use warnings;
+use Scalar::Util qw/blessed/;
+
@hexfusion
hexfusion / gist:7414815
Created November 11, 2013 15:21
dbic or statement example
# create nav iterators
my $nav = schema->resultset('Navigation')->search({
-or => [
type => 'nav',
type => 'menu'
],
});
while (my $record = $nav->next) {
package # Hide from PAUSE
DBIx::Class::SQLMaker::SQLStatement;
use parent 'DBIx::Class::SQLMaker';
# SQL::Statement does not understand
# INSERT INTO $table DEFAULT VALUES
# Adjust SQL here instead
sub insert { # basically just a copy of the MySQL version...
my $self = shift;
@hexfusion
hexfusion / gist:7724203
Created November 30, 2013 20:42
stage variants and make sure that existing items keep proper information
UPDATE variants_staging as VS
JOIN variants AS V
ON VS.manf_sku = V.manf_sku
set VS.image = V.image, VS.style = 'Image', VS.code = V.code, VS.sku = V.sku
WHERE V.manf_sku = VS.manf_sku
@hexfusion
hexfusion / Review.pm
Last active December 30, 2015 08:59
proposed review schema
use utf8;
package Interchange6::Schema::Result::Review;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
=head1 NAME
Interchange6::Schema::Result::Review
@hexfusion
hexfusion / Country.pm
Last active December 30, 2015 11:29
proposed country table
use utf8;
package Interchange6::Schema::Result::Country;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
=head1 NAME
Interchange6::Schema::Result::Country
@hexfusion
hexfusion / ic6sig.html
Last active December 30, 2015 11:59
interchange6 signature
<br />
<br />
<div id="sig" style="min-width: 960px; min-height: 82px; line-height: 18px; margin: 6px 0; padding: 8px; border-top: 1px #999999 dotted; border-bottom: 1px #999999 dotted; font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; font-size: 12px; color: #999999; " >
<a href="http://icdevgroup.org" title="icdevgroup.org"><img src="http://www.westbranchangler.com/assetstore/site/images/ic6.png" alt="Interchange6" style="float: left; padding: 2px 6px 0 0; border: none;"></a>
<div style="padding: 6px 0 0 0">
<span style="font-size:14px"><strong style="color: #333333">Sam Batschelet</strong>, 'hexfusion'</span><br />
<strong><a href="http://icdevgroup.org.com" title="icdevgroup.org" style="color: #666666; text-decoration: none; border-bottom: 1px #cccccc dotted;">Team IC6</a></strong><br />
[email protected]
<br />
<a href="https://github.com/interchange"><img src="http://www.westbranchangler.com/assetstore/site/images/github_16.png" alt="Github" style="float: left; margin: 2px 4px 0 0; border: no
@hexfusion
hexfusion / gist:7852970
Last active December 30, 2015 16:09
populate countries table with Locale::Country and DBIC
#! /usr/bin/env perl
use strict;
use warnings;
use Locale::Country;
use Interchange6::Schema;
my $dsn = shift;
my $schema = Interchange6::Schema->connect($dsn);