This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Data::Dump qw(dump); | |
use Parallel::ForkManager 0.7.6; | |
my @servers = map { sprintf("svr%03d", $_) } (1 .. 1000); | |
my %results; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Index; | |
use Mouse; | |
use namespace::autoclean; | |
use Index::Types; | |
has 'date' => ( | |
is => 'rw', | |
isa => 'Index::Types::Date', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Spelling corrected: Schwartzian transform | |
2. No need to use parens around \d{8}. | |
3. I like ST better, but GRT is faster for large lists: | |
http://www.perlmonks.org/?node_id=145659 | |
4. Need to warn or die to show bad data when regex fails. | |
5. Perl 6 automatically does ST for you: | |
my @sorted = @files.sort({ / SWITCH _ \d**8 _ (\d**6) / or die; $0; }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
# 2016-02-09 <[email protected]> | |
my $length = @*ARGS.shift; | |
say "Length = $length"; | |
my @x = 1..$length; | |
my @y = @x.reverse; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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'); | |
} | |
}); |