Skip to content

Instantly share code, notes, and snippets.

View arisawa's full-sized avatar

Kosuke Arisawa arisawa

View GitHub Profile
@arisawa
arisawa / upgrade-karafka-v2.md
Created June 27, 2022 05:26
Upgrade karafka v2

Prerequisites

  • The base gem changed from ruby-kafka to rdkafka
    • waterdrop gem too
    • configuration must change
    • librdkafka-devel package is required
  • Responder is deleted
  • Consume multiple messages
    • Rename attribute params to messages in BaseConsumer
  • Remove pidfile support
@arisawa
arisawa / trello-actions.rb
Created August 18, 2015 02:16
ミーティング時に動かした trello のカードを markdown の list 形式で書き出す
#!/usr/bin/env ruby
require 'trello'
require 'dotenv'
require 'pry'
Dotenv.load
Trello.configure do |config|
config.developer_public_key = ENV['TRELLO_DEVELOPER_PUBLIC_KEY']
@arisawa
arisawa / gg.pl
Created March 3, 2013 11:17
Execute google search in your browser
#!/usr/bin/env perl
=head1 DESCRIPTION
Execute google search in your browser
=head1 SYNOPSIS
% gg.pl [Options] Word(s)
@arisawa
arisawa / arigachi.pl
Created February 18, 2013 19:07
ありがちな処理を Exception::Tiny と Try::Lite で
#!/usr/bin/env perl
use strict;
use warnings;
use feature qw/say/;
use utf8;
use Exception::Tiny;
package MyException;
use parent 'Exception::Tiny';
use Class::Accessor::Lite (
@arisawa
arisawa / parse_carton_lock.pl
Created February 12, 2013 07:59
Example::Module~0.01
#!/usr/bin/env perl
use strict;
use warnings;
use feature qw/say/;
use File::Slurp qw/read_file/;
use JSON;
my $fname = shift @ARGV || "./carton.lock";
my $carton = decode_json( read_file($fname) );
@arisawa
arisawa / mqh_install.sh
Created September 11, 2012 23:48 — forked from masaki/mqh_install.sh
Installing MySQL5.1 / Q4M / HandlerSocket
#!/bin/zsh
MYSQL_VERSION=5.1.63
if [ `which perl` = "/usr/bin/perl" ]; then
echo -n -e "\e[1;31mUSING SYSTEM PERL OK? [y/n]\e[m: "
read ANSWER
if [ "$ANSWER" != "y" ]; then
exit 255
fi
@arisawa
arisawa / gist:1264230
Created October 5, 2011 11:24
FCGI が orepan_index.pl で index されない問題
--- Archive.pm 2011-10-05 20:18:08.000000000 +0900
+++ Archive.pm.new 2011-10-05 20:18:32.000000000 +0900
@@ -161,7 +161,7 @@
my $basename = fileparse("$parsefile");
$basename =~ s/\..+$//;
my @candidates = sort { !$a->[1] <=> !$b->[1] }
- grep { $_->[0] =~ m/$basename$/ } @pkgs;
+ grep { $_->[0] =~ m/($basename)$/ || $basename eq 'version' } @pkgs;
return @{$candidates[0]} if @candidates;
return;
@arisawa
arisawa / get_distname.pl
Created September 22, 2011 14:56
get distname to using module
#!/usr/bin/env perl
use strict;
use LWP::Simple;
use YAML;
use CPAN::DistnameInfo;
use Module::CoreList;
while (my $module = <>) {
chomp $module;
my $yaml = get("http://cpanmetadb.appspot.com/v1.0/package/$module");
@arisawa
arisawa / gist:1143624
Created August 13, 2011 08:32
switching perlbrew in .bashrc
appswitch () {
if [ $1 = "app_is_not_selected" ]; then
APP_LC="not selected"
export PERLBREW_ROOT=$HOME/perl5/perlbrew
else
APP=$1
APP_LC=`echo $APP | tr '[A-Z]' '[a-z]'`
export PERLBREW_ROOT=$HOME/perl5/$APP_LC/perlbrew
fi