Skip to content

Instantly share code, notes, and snippets.

View jonasbn's full-sized avatar
🤚
keeping my distance

Jonas Brømsø jonasbn

🤚
keeping my distance
View GitHub Profile
@jonasbn
jonasbn / task1.py
Last active October 8, 2016 08:03
Nordea task 1, GOTOCopenhagen 2016
#!/usr/bin/env python
import re
import unittest
import string
def isSubstring (s1, s2):
# We do the matching
result = re.search(s2, s1)
@jonasbn
jonasbn / travis.yml
Last active December 16, 2016 08:08
Travis configuration for Github Travis when using Dist::Zilla
sudo: false # Migrating from legacy to container-based infrastructure for Travis
# Ref: http://docs.travis-ci.com/user/migrating-from-legacy/
language: perl
perl:
- "5.22"
- "5.20"
- "5.18"
- "5.16"
- "5.14"
- "5.12"
@jonasbn
jonasbn / dist.ini
Last active August 29, 2015 14:27
Skeleton dist.ini for Dist::Zilla
name =
author = Jonas B. Nielsen <jonasbn@cpan.org>
license = Artistic_2_0
copyright_holder = Jonas B. Nielsen
[@Basic]
[VersionFromModule]
[GitHub::Meta]
@jonasbn
jonasbn / build-cpanfile.sh
Created August 14, 2014 12:28
Build a cpanfile file from Module::Build requirements specified in Build.PL
#!/bin/bash
./Build prereq_report | perl -pi -e 'm/([\w:]+)\s+([\d\.]+)\s+/; if ($1) { print STDERR "requires '\''$1'\''"; print STDERR ", '\''$2'\''" if $2; print STDERR ";\n" }' > /dev/null
@jonasbn
jonasbn / critic.t
Created August 2, 2014 21:00
Test::Perl::Critic test
# Courtesy of Jeffrey Ryan Thalhammer
# http://search.cpan.org/~thaljef/Test-Perl-Critic/lib/Test/Perl/Critic.pm
# The severity parameter interpretation was added by jonasbn
# See: http://logiclab.jira.com/wiki/display/OPEN/Test-Perl-Critic
use strict;
use warnings;
use File::Spec;
use Test::More;
@jonasbn
jonasbn / changes.t
Created August 2, 2014 20:59
Test::CPAN::Changes test
use strict;
use warnings;
use Test::More;
eval 'use Test::CPAN::Changes';
plan skip_all => 'Test::CPAN::Changes required for this test' if $@;
changes_ok();
@jonasbn
jonasbn / perltidyrc
Last active November 18, 2017 09:40
My Perl::Tidy resourcefile
# REF: http://www.perlmonks.org/?node_id=485885
# PBP .perltidyrc file
-l=78 # Max line width is 78 cols
-i=4 # Indent level is 4 cols
-ci=4 # Continuation indent is 4 cols
-ce # Cuddled elses
#-st # Output to STDOUT
-se # Errors to STDERR
-vt=2 # Maximal vertical tightness
@jonasbn
jonasbn / Module-Build.sublime-build
Created August 1, 2014 08:28
Module::Build build system for SublimeText
{
"build_systems":
[
{
"name": "Module::Build",
"cmd": ["perl Build.PL --verbose=1 ; ./Build"],
"working_dir": "${project_path:${folder}}",
"selector": "source.perl",
"shell": true,
@jonasbn
jonasbn / pod-syntax.t
Last active August 29, 2015 14:04
Test::Pod test (pod syntax test)
use Test::More;
eval "use Test::Pod 1.14";
plan skip_all => 'Test::Pod 1.14 required' if $@;
plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
all_pod_files_ok();
@jonasbn
jonasbn / pod-coverage.t
Created July 31, 2014 14:28
Pod::Coverage tests
#pod test courtesy of petdance
#http://use.perl.org/~petdance/journal/17412
use Test::More;
eval "use Test::Pod::Coverage 0.08";
plan skip_all => "Test::Pod::Coverage 0.08 required for testing POD coverage" if $@;
all_pod_coverage_ok();