Skip to content

Instantly share code, notes, and snippets.

View ios_ranking_to_slack.pl
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use LWP::UserAgent;
use JSON;
use Getopt::Long qw(:config posix_default no_ignore_case gnu_compat);
use Pod::Usage qw(pod2usage);
@masaki
masaki / 1min_radar.patch
Created Jun 28, 2016
CloudForecast 1min graph and configurable radar interval
View 1min_radar.patch
diff --git a/lib/CloudForecast/Data.pm b/lib/CloudForecast/Data.pm
index 78c9f73..9c2983a 100644
--- a/lib/CloudForecast/Data.pm
+++ b/lib/CloudForecast/Data.pm
@@ -647,6 +647,8 @@ sub init_rrd {
}
}
+ my $interval = $self->global_config->{interval} || 300;
+
View gist:d9f453b04ef07791eca9
diff --git a/lib/App/cpanminus/script.pm b/lib/App/cpanminus/script.pm
index 2d0a845..56c1aa3 100644
--- a/lib/App/cpanminus/script.pm
+++ b/lib/App/cpanminus/script.pm
@@ -1747,7 +1747,7 @@ sub resolve_name {
# Git
if ($module =~ /(?:^git(?:\+\w+)?:|\.git(?:@.+)?$)/) {
- return $self->git_uri($module);
+ return $self->git_uri($module, $version);
View rspec.txt
desc 1 before all
cont 1 before all
desc 1 before each
cont 1 before each
exam 1 before
exam 1 after
cont 1 after each
desc 1 after each
cont 1-1 before all
desc 1 before each
@masaki
masaki / make_sandbox_from_installed_64bit.patch
Created Feb 26, 2014
MySQL::Sandbox make_sandbox_from_installed 64bit patch
View make_sandbox_from_installed_64bit.patch
diff --git a/bin/make_sandbox_from_installed b/bin/make_sandbox_from_installed
index 7b3b5d8..47976c0 100755
--- a/bin/make_sandbox_from_installed
+++ b/bin/make_sandbox_from_installed
@@ -98,8 +98,13 @@ for my $prefix (@prefixes) {
{
$found_install_db =1;
}
- if ( glob("$prefix/lib/mysql/libmysqlclient*")
- or glob( "$prefix/lib/libmysqlclient*") ) {
View Persistent.pm
package Test::mysqld::Persistent;
use strict;
use warnings;
use Test::mysqld;
use JSON;
use File::Spec;
sub new {
my ($class, %args) = @_;
@masaki
masaki / setup_perl.sh
Last active Jan 4, 2016
setup languages
View setup_perl.sh
#!/bin/bash
[ -e "$HOME/.plenv" ] && rm -rf $HOME/.plenv
git clone git@github.com:tokuhirom/plenv.git $HOME/.plenv
echo '[ -d "$HOME/.plenv/bin" ] && [ `echo $PATH | grep "$HOME/.plenv/bin"` ] || export PATH="$HOME/.plenv/bin:$PATH"' >> $HOME/.zshrc
echo 'if which plenv > /dev/null; then eval "$(plenv init -)"; fi' >>$HOME/.zshrc
mkdir -p $HOME/.plenv/plugins
git clone git@github.com:tokuhirom/Perl-Build.git $HOME/.plenv/plugins/perl-build
View gist:5395424
Can't convert 'Module::CPANfile::Requirement=HASH(0x96855c8)': Invalid version format (non-numeric data)
! Couldn't find module or a distribution Amon2::Lite~Module::CPANfile::Requirement=HASH(0x8f3a910) ()
View perlqahack2013.md
  • carton install -f /path/to/cpanfile
  • enable to specify "carton bundle" cache path
  • move 02packages from .cpan/ to cache path
  • enable "via" in cpanfile
requires 'carton',
    via => 'git://github.com/masaki/carton.git',
    commitish => 'devel';
View 01_simple.pl
use OAuth::Lite::Consumer;
use Furl 2.08;
my $oauth = OAuth::Lite::Consumer->new(
ua => Furl->new(keep_request => 1),
);
my %args = (
method => 'POST',
url => 'http://example.com/oauth',