Skip to content

Instantly share code, notes, and snippets.

Marcel Grünauer MarcelGruenauer

Block or report user

Report or block MarcelGruenauer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@MarcelGruenauer
MarcelGruenauer / wwdc_to_vtt.pl
Last active Nov 14, 2016
Create .vtt subtitles for WWDC 2016 session videos
View wwdc_to_vtt.pl
#!/usr/bin/env perl
use strict;
use warnings;
use HTML::TreeBuilder::XPath;
my $tree = HTML::TreeBuilder::XPath->new;
my $xml = do { local $/; <STDIN> };
$tree->parse($xml);
my $p = $tree->findnodes('//span[@data-start]');
for my $node (@$p) {
my $start = $node->findvalue('./@data-start');
View 07-10c-mcmillen-review.sgf
(;GM[1]FF[4]SZ[19]AP[SmartGo:0.6.8.0]CA[utf-8]
GN[2016-07-10c]
PW[Colin]
PB[Shawn]
EV[MGA Summer Tournament]
DT[2016-07-10]
KM[0.5]
RU[AGA (Area)];B[pd];W[dc];B[dp];W[pp];B[de];W[fd]
(;B[cd]
(;W[nc];B[lc]
View labels.sgf
(;GM[1]FF[4]SZ[19]AP[SmartGo:0.6.6]
GN[2016-04-16a]
PW[Human]
PB[Human]
DT[2016-04-16]
KM[6.5]
RU[Simple];B[qj]
C[Labels at a1, b2, c3, d4, e5, f6, g7, h8, i8, j9, k10, l11, m12, n13, o14, p15, q16, r17, s18 and t19.]
)
View test.pl
#!/usr/bin/env perl
use strict;
use warnings;
use v5.10;
use MetaCPAN::Client;
my $client = MetaCPAN::Client->new;
my $result = $client->all(
'releases',
{ es_filter => {
and => [
View tarzan.pl
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
my %re =
(skip_fail => qr/ (?: "Tarzan" | Tarzanus ) (*SKIP)(*FAIL) | Tarzan /x);
while (my ($name, $re) = each %re) {
subtest "$name: $re", sub {
ok $_ =~ $re, $_
for ('Tarzan', '"Tarzan und Jane"', '"Jane und Tarzan"', 'Tarzanium');
View wwdc2015.pl
#!/usr/bin/env perl
use strict;
use warnings;
use v5.14;
use Mojo::UserAgent;
use Getopt::Long;
GetOptions('hd' => \(my $hd)) or die;
my $index_url = 'https://developer.apple.com/videos/wwdc/2015/';
my $quality = $hd ? 'hd' : 'sd';
my $ua = Mojo::UserAgent->new;
View journal.gobook
::book(#marcel) title="Go Journal" author="Marcel Grünauer"
::chapter(#contents)
::h1 break=none #title#
::s1 #author#
::s2 Table of Contents
View math.txt
instructions:
double
halve
mul10
div10
store # store in register
addreg # add register
subreg # subtract register
# utilities
@MarcelGruenauer
MarcelGruenauer / gather-take.swift
Last active Aug 29, 2015
gather/take in Swift
View gather-take.swift
func gather<T> (gatherer: (take: (T) -> ()) -> ()) -> [T] {
var gathered: [T] = []
gatherer { (item: (T)) in gathered.append(item) }
return gathered
}
// Example:
let numbers = [5, 3, 9, 10, 12]
View bst.pl
#!/usr/bin/env perl
# http://dandreamsofcoding.com/2014/03/18/dissecting-an-interview-question/
use strict;
use warnings;
use Data::Dumper;
my $t = BST->new;
$t->insert(10);
$t->insert(20);
$t->insert(5);
$t->insert(15);
You can’t perform that action at this time.