Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
function httpstatus () {
result=`curl -kL http://www.studyinghttp.net/status_code 2> /dev/null | grep '<li><a href="#Code..."><code class="Status">...</code> ' | sed -e 's/<li><a href="#Code..."><code class="Status">//' -e 's/<\/code>//' -e 's/<\/a><\/li>//' | grep ^$1`
if [ "$result" = "" ]; then
curl -kL http://www.studyinghttp.net/status_code 2> /dev/null | grep '<li><a href="#Code..."><code class="Status">...</code> ' | sed -e 's/<li><a href="#Code..."><code class="Status">//' -e 's/<\/code>//' -e 's/<\/a><\/li>//' | grep $1
else
echo "$result"
fi
}
package Log::Dispatch::Screen::Color::Emotional;
use strict;
use warnings;
use parent 'Log::Dispatch::Screen::Color';
our $EMOTION = {
debug => '(☼ Д ☼)',
info => 'm9(^Д^)',
warn => '(´・ω・`)',
critical => '(; Д ) ゜ ゜',
@yappo
yappo / Try.pl
Created February 15, 2013 05:29
use strict;
use warnings;
sub try (&;@) {
my($cb, @catches) = @_;
local $@;
my $wantarray = wantarray;
my @ret;
use strict;
use warnings;
use Test::More;
{
package Model;
use parent 'Teng';
}
{
use strict;
use warnings;
package Model {
use parent 'Teng';
}
package Model::Schema {
use Teng::Schema::Declare;
table {
use strict;
use warnings;
use Test::More;
use Text::Xslate;
subtest 'scope ok' => sub {
my $tx = Text::Xslate->new({
syntax => 'TTerse'
});
use strict;
use warnings;
use AnySan::Provider::IRC;
use String::IRC;
my $irc = irc
'irc.freenode.net',
key => 'example1',
nickname => 'AnySan1',
@yappo
yappo / gist:3496510
Created August 28, 2012 09:25
photo_tweet.pl
use strict;
use warnings;
use utf8;
use 5.017;
use Config::Pit;
use Encode;
use Net::Twitter::Lite;
binmode STDOUT => 'utf8';
use strict;
use warnings;
use 5.017;
use utf8;
use B;
use Encode;
{
sub MODIFY_CODE_ATTRIBUTES {
class Foo {
sub new {
}
}
Foo.new();