Skip to content

Instantly share code, notes, and snippets.

@racke
racke / expire_session
Created September 13, 2012 14:23
Expiration script for file-based Dancer sessions
#! /usr/bin/env perl
#
# Dancer session expiration script.
#
# Copyright (C) 2011 Stefan Hornburg (Racke) <racke@linuxia.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
@racke
racke / InterchangeLink.pm
Created September 14, 2012 07:26
Dancer::Plugin::InterchangeLink
@racke
racke / gist:8152545
Created December 27, 2013 20:59
Thoughts about product attributes for Interchange 6
Table attributes:
attributes_id: AUTO
name: name / code of attribute
title: displayed title of attribute
Table attributes_values:
attributes_values_id: AUTO
attributes_id: FOREIGN KEY attributes::attributes_id
@racke
racke / gist:8169718
Created December 29, 2013 12:03
Simple Solr startup wrapper
#! /bin/bash
#
# Very basic init script for usage with eShop.
#
# Copyright 2013 Stefan Hornburg (Racke) <racke@linuxia.de>.
SOLR_HOME="$HOME/solr/example"
SOLR_LOGFILE=$(readlink -f ../../logs/solr.log)
SOLR_PIDFILE=$(readlink -f ../../run/solr.pid)
#! /usr/bin/env perl
use strict;
use warnings;
use Dancer ':script';
use Getopt::Long;
use Dancer::Plugin::Interchange6;
my $duration;
@racke
racke / html2flute
Created March 21, 2014 11:41
HTML2FLUTE - rough try
#!/usr/bin/env perl
use strict;
use warnings;
use File::Spec;
use File::Copy::Recursive qw/rcopy/;
use File::Find;
use Data::Dumper;
use XML::Twig;
use File::Path qw/mkpath/;
@racke
racke / SessionCrossover.pm
Created April 3, 2014 07:32
Interchange5 Session Crossover Plugin
package Dancer::Plugin::Interchange5::SessionCrossover;
use warnings;
use strict;
use Dancer::Plugin;
use Dancer qw/:syntax/;
use Storable qw/thaw freeze/;
# this plugin nesting is not going to work with D2, until further notice :-\
use Dancer::Plugin::Database;
@racke
racke / plackup-app.pl
Created June 23, 2015 09:58
Generic plackup script for camps
#!/bin/bash
# determine camp number
for CAMPDIR in "$PWD" "${PWD%/*}" "${PWD%/*/*}"; do
if [[ $CAMPDIR =~ ([[:digit:]]+)$ ]]; then
CAMPNUMBER=${BASH_REMATCH[1]}
break
fi
done
@racke
racke / dh-prepare-upgrade
Last active November 24, 2021 05:18
DH scripts
#!/usr/bin/env perl
use warnings;
use strict;
use Dancer qw/:script/;
use Dancer::Plugin::DBIC;
use DBIx::Class::DeploymentHandler;
my $schema = schema;
@racke
racke / script
Created November 18, 2015 13:50
Git filter branch
git filter-branch \
--prune-empty \
--index-filter '
git ls-tree -z -r --name-only --full-tree $GIT_COMMIT \
| grep -z -v "^applications/CalevoMobile/lib/CalevoMobile/Schema" \
| xargs -0 -r git rm --cached -r
' \
-- \
feature/split_out_schema
git filter-branch \