Skip to content

Instantly share code, notes, and snippets.

View artifactsauce's full-sized avatar

Kenji Akiyama artifactsauce

View GitHub Profile
@artifactsauce
artifactsauce / conv-pg_dump-tsv.pl
Last active March 13, 2024 13:17
Convert from a pg_dump data file to TSV files for LOAD DATA INFILE.
#!/usr/bin/env perl
use strict;
use warnings;
use Path::Class;
use FindBin;
my $output_dir = dir($FindBin::Bin,"data");
$output_dir->is_dir or die "[ERROR] $output_dir is not a directory.";
@artifactsauce
artifactsauce / conv-ja2utf8.pl
Created January 7, 2014 06:57
Convert from a Japanese encoding file to UTF-8.
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Encode;
use Encode::Guess qw/shift-jis euc-jp 7bit-jis/;
use Perl6::Slurp;
use Path::Class;
#!/bin/bash
set -eu
API_TOKEN="<CHANGE_THIS>"
ROOM_ID="<CHANGE_THIS>"
REPOS=$(basename $(pwd))
REPOS=${REPOS%.*}
#!/usr/bin/env bash
set -eu
RUBY_VERSION="2.1.2"
if ! which -s brew; then
echo "[ERROR] Homebrew is required."
exit 1
fi
@artifactsauce
artifactsauce / post-update
Last active March 9, 2017 04:34
gitの共有リポジトリにpushしたらSlackとChatworkにメッセージを通知する ref: http://qiita.com/artifactsauce/items/242c71428fa85307c182
#!/usr/bin/env perl
package MyApp::Notifier::Base;
use warnings;
use LWP::UserAgent;
sub new {
my $class = shift;
my $self = { @_ };
@artifactsauce
artifactsauce / deploy.rb
Last active December 11, 2017 17:03
Notification tasks for Slack with Capistrano.
namespace :notify do
namespace :update do
task :start do
_send_message("[\`#{fetch(:application)}\`] Deployment has started.")
end
task :finish do
_send_message("[\`#{fetch(:application)}\`] Deployment has finished. :ok_woman:\n> #{fetch(:commit_message)}")
end
end
@artifactsauce
artifactsauce / cpanfile
Last active August 29, 2017 13:50
サーバー側での処理結果をPushbulletで通知する ref: http://qiita.com/artifactsauce/items/b4165ec1229d1ce3f1dd
requires 'LWP::Protocol';
requires 'LWP::Protocol::https';
requires 'JSON';
@artifactsauce
artifactsauce / Terminal
Last active January 9, 2017 21:29
JXAでChromeの新規Windowに複数のタブを開く ref: http://qiita.com/artifactsauce/items/02da9a29491519cb198b
$ osacompile -l JavaScript -x -o ~/Desktop/open-pages.app ./open-pages.js
#!/bin/bash
set -eu
LOGGER_LOG_LEVEL=4
BASE_DIR=$(pwd)
LIB_DIR=$HOME/src/github.com/artifactsauce/proglets/lib/bash
. $LIB_DIR/functions
. $LIB_DIR/logger
@artifactsauce
artifactsauce / app.pl
Created August 22, 2016 07:37
Simple test script to post to slack
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use JSON;
use Data::Dumper;
use LWP::UserAgent;
my $url = $ENV{SLACK_WEBHOOK_URL};