Skip to content

Instantly share code, notes, and snippets.

View perlpunk's full-sized avatar

Tina Müller (tinita) perlpunk

View GitHub Profile
@perlpunk
perlpunk / file with spaces
Last active August 29, 2015 14:25
nur ein test
spaces...
tab: eol
@perlpunk
perlpunk / gist.vim
Created July 17, 2015 22:05
git-hub-gist-new.vim
function! gist#Gist(type,desc)
let description = a:desc
if description == ""
let description = input('Enter description for gist: ')
endif
" TODO: escape description and file name?
let cmd = "git hub gist-new " . a:type ." '" . description . "' '" . expand('%:t') . "'"
if confirm('Exec command: ' . cmd, "&Yes\n&No", 1)==1
@perlpunk
perlpunk / Example.pm
Last active August 29, 2015 14:26
DBIx::Class Bug with Sybase and Identity Retrieval
use utf8;
package Example;
use strict;
use warnings;
use base 'DBIx::Class::Schema';
__PACKAGE__->load_namespaces();
@perlpunk
perlpunk / lastfm-user-toptracks-tags.pl
Last active August 29, 2015 14:27 — forked from hoehrmann/lastfm-user-toptracks-tags.pl
For a given last.fm user, retrieves all their top tracks, and for each track, all tags for the track, and then prints out the 7 most-used tags for each track.
#!/usr/bin/env perl -w
use strict;
use warnings;
use JSON;
use LWP::UserAgent;
use URI;
use URI::QueryParam;
my $ua = LWP::UserAgent->new;
@perlpunk
perlpunk / git-hub-event
Created January 25, 2016 10:05
git-hub-event-bug
#!/usr/bin/env bash
set -e
command:event-user() {
get-args owner:get-user
title="Events for '$owner':"
report-list \
"/users/$owner/events" \
"id created_at type repo/name payload/ref_type payload/ref payload/master_branch created_at payload/action"
@perlpunk
perlpunk / deserialize.t
Created July 4, 2016 22:30
t/deserialize.t
use strict;
use warnings;
use Test::More;
use Plack::Test;
use HTTP::Request::Common;
{
package App;
use Dancer2;
#!/bin/bash
# makes breaking and joining panes a bit more comfortable
if [[ "$#" -lt 2 ]]; then
echo "Usage:"
echo " $0 (break|join) (<params>) [options]"
echo " $0 break <title> [ break-pane options ]"
echo " $0 join (<title>|-) [ join-pane options ]"
echo ""
2017-09-09 20:51:17 < tinita> flyx, ingy when I added tests with tags, i often used !foo or !a, !b
2017-09-09 20:51:31 < tinita> when loading, frameworks complain about those
2017-09-09 20:51:51 < tinita> so i think i should convert those to !!str, etc. where appropriate
2017-09-09 20:52:02 < tinita> so that we can better test loading
2017-09-09 20:52:22 < flyx> if the framework is not low-level enough, the problem is probably that it tries to resolve the t
ag to a type and finds none that is registered
2017-09-09 20:52:51 < flyx> perhaps we can first evaluate whether the test adapter for the framework uses the apropriate API
?
2017-09-09 20:53:21 < flyx> I would be confused if a framework rejects !a when only an event stream is queried
2017-09-09 20:53:28 < tinita> for example, pyyaml or ruamel can parse it, but the loader complains
@perlpunk
perlpunk / bool.pl
Last active April 21, 2018 11:24
boolean vs. JSON::PP
#/usr/bin/env perl
use strict;
use warnings;
use 5.010;
use JSON::PP;
use boolean;
use Text::Table;
my @headers = ('', qw/ boolean::true JSON::PP::true boolean::false JSON::PP::false /);
my $tb = Text::Table->new(@headers);
@perlpunk
perlpunk / block-scalar.yaml
Created December 9, 2017 01:14
block scalars
- just a string
- | # a literal block scalar
the content will be loade as written here
with all trailing spaces and newlines
- > # a folded block scalar
these lines will
be folded to
one line