Skip to content

Instantly share code, notes, and snippets.

@Woody2143
Woody2143 / humble_bundle_file_downloader.js
Last active February 2, 2018 14:44
@graymouser (https://gist.github.com/graymouser/a33fbb75f94f08af7e36) came up with the initial bit of javascript code to paste in to a console window on the humble bundle site to download files. The resulting discussion lead to some nice code by @oxguy3 but I wanted one last addition on that. So below is my code to save the file as the title of…
/*
This no longer works. They changed how their page renders. The good news is that an alternative is in the works.
There is a single request fo their order API that gives a JSON response with all of the download links. A quick
script to parse that should generate a list of download links and files to save as. Stand-by...
*/
@Woody2143
Woody2143 / hb_all_books_dl.js
Created September 14, 2017 16:42 — forked from graymouser/hb_all_books_dl.js
Humble bundle book bundles - download all books at once
/*
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window for the page and paste in the below javascript
*/
$('a').each(function(i){
if ($.trim($(this).text()) == 'MOBI') {
$('body').append('<iframe id="dl_iframe_'+i+'" style="display:none;">');
document.getElementById('dl_iframe_'+i).src = $(this).data('web');
}
});
@Woody2143
Woody2143 / some_website
Created June 14, 2016 20:33 — forked from mvickers/some_website
Basic Centos init script for Dancer apps
#!/bin/sh
#
# some_website - this script starts and stops some_website
#
# chkconfig: - 85 15
# description: Some website description
# pidfile: /var/run/plackup.some_website.pid
PID=/var/run/plackup.some_website.pid
telephoneNumber: 4045554400
mobile: 2145555000
reversedPhone:0005555412
reversedPhone:0044555404
title: Operations Engineer
cn: Smith, John
telephoneNumber: 6785554400
mobile: 3015555000
reversedPhone:0005555103
@Woody2143
Woody2143 / testDiag.pl
Created October 10, 2013 20:26
Benchmark of array vs hash for unique values
#!/opt/perlbrew/perls/cdrtools/bin/perl
# THIS IS HIDEOUS CODE WRITTEN by MDW; blame him. :P
use warnings;
use strict;
use Benchmark qw(:all);
my %recordTypes = (
START => \&startRecords,
@Woody2143
Woody2143 / 01-Multiplication.t
Last active December 22, 2015 07:48
When I use 'use' I get the 'Use of uninitialized value in multiplication (*)' warning in the test; when 'require' is used I do not. Really that appears to be the only difference. Funny thing is the test still passes even with the 'uninitialized value' warning. So it's likely I'm missing something else entirely... Advice and criticisms are welcome.
#!/usr/bin/env perl
use Modern::Perl;
use Test::More;
require Money;
require Dollar;
require Franc;
subtest 'Dollar subtest' => sub {
@Woody2143
Woody2143 / Schwartzian.pl
Last active December 19, 2015 01:39
My first time using a Schwartzian-transform
#!/opt/perlbrew/perls/cdrtools/bin/perl
use Modern::Perl;
use Data::Dumper;
my @files = qw(
/data/switch/cdr/SWITCH_20130627_151800
/data/switch/cdr/SWITCH_20130627_151500
/data/switch/cdr/SWITCH_20130627_151900
/data/switch/cdr/SWITCH_20130627_151700
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
var socket;
$(function() {
// ws_path should be of the form ws://host/_hippie/ws
var ws_path = "ws:<% request.base.opaque %>_hippie/ws";
@Woody2143
Woody2143 / net
Created March 1, 2013 15:28 — forked from matsuu/net
config_eth0="aaa.bbb.ccc.ddd/23"
routes_eth0="default via aaa.bbb.ccc.1"
dns_servers_eth0="210.224.163.4 210.224.163.3"
iptunnel_6rd="mode sit local aaa.bbb.ccc.ddd ttl 64"
config_6rd="2001:e41:xxxx:xxxx::1/32" # printf "2001:e41:%02x%02x:%02x%02x::1\n" aaa bbb ccc ddd
routes_6rd="::/0 via ::61.211.224.125 dev 6rd"
mtu_6rd="1280"
postup() {
@Woody2143
Woody2143 / cover -test output
Created November 13, 2012 18:57
Devel::Cover, Testing and Taint Mode
[user@host dev]$ cover -test
Deleting database /var/www/html/dev/cover_db
cover: running make test "OPTIMIZE=-O0 -fprofile-arcs -ftest-coverage" "OTHERLDFLAGS=-fprofile-arcs -ftest-coverage"
PERL_DL_NONLAZY=1 /opt/perlbrew/perls/cgitools/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/taint.t .. Devel::Cover: Error getting @INC: Insecure dependency in `` while running with -T switch at /opt/perlbrew/perls/cgitools/lib/site_perl/5.14.2/x86_64-linux/Devel/Cover.pm line 125.
Reverting to default value for Inc.
t/taint.t .. ok
All tests successful.
Files=1, Tests=2, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.28 cusr 0.02 csys = 0.34 CPU)