Skip to content

Instantly share code, notes, and snippets.

@niratama
niratama / routefile_util.rb
Created February 10, 2016 08:20
winebarrel/roadworkerのRoutefileのhosted_zoneに追記するための追加スクリプト
# -*- mode: ruby -*-
# vi: set ft=ruby :
def add_hosted_zone(name, &block)
new_zone = HostedZone.new(name, [], &block).result
zone = @result.hosted_zones.find { |z| z.name == new_zone.name }
if zone then
zone.vpcs.concat(new_zone.vpcs)
zone.resource_record_sets.concat(new_zone.resource_record_sets)
end
@niratama
niratama / gist:d662274231d0750a8fa2
Last active February 1, 2016 06:48
macvim-kaoriya起動時のエラーメッセージ
mahiru:~ kenichi$ brew cask install macvim-kaoriya
==> Caveats
Cask macvim-kaoriya installs files under "/usr/local". The presence of such
files can cause warnings when running "brew doctor", which is considered
to be a bug in homebrew-cask.
Note that homebrew also provides a compiled macvim Formula that links its
binary to /usr/local/bin/mvim. And the Cask MacVim also does. It's not
recommended to install both the Cask MacVim KaoriYa and the Cask MacVim
and the Formula of MacVim.
@niratama
niratama / gist:a4ae50b227b69bfa5322
Last active August 29, 2015 14:24
LAWSON×INGRESS MACHI café DRINK CARD 販売店一覧CSV作成ツール
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use Encode qw(encode_utf8 decode_utf8);
use JSON;
use File::Slurp;
use LWP::Simple;
@niratama
niratama / Vagrantfile
Created June 25, 2015 13:02
IPv6無効化時にyrmcdsが起動に失敗する件の再現環境
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "centos6.6"
config.vm.provision "ansible" do |ansible|
ansible.playbook = "playbook.yml"
ansible.verbose = "v"
end
end
@niratama
niratama / gist:1eb631b46a6d6ba1b2d2
Created April 1, 2015 05:02
ISHマルチボリューム対応版をOS Xでビルドするためのやっつけパッチ
diff --git a/ish.c b/ish.c
index eadfecb..dd7537f 100644
--- a/ish.c
+++ b/ish.c
@@ -52,7 +52,7 @@ char *filename = "file.ish";
int mline = 0;
int lfflag = 0;
-FILE *opath = stdout;
+FILE *opath;
@niratama
niratama / MyObj.pm
Created February 19, 2015 07:22
呼び出し元のサブルーチンを呼び出す(coderef版)
package MyObj;
use strict;
use warnings;
sub new {
my $class = shift;
return bless { name => shift }, $class;
}
sub method {
@niratama
niratama / MySub.pm
Created February 19, 2015 06:40
呼び出し元のサブルーチンを呼び出す
package MySub;
use strict;
use warnings;
use MySub2;
sub callback {
print "in MySub::callback($_[0])\n";
}
@niratama
niratama / gist:39409a3992d341bc2359
Created February 6, 2015 17:58
goで正規表現を使ってstructにparseする実験
package main
import (
"fmt"
"reflect"
"time"
"strconv"
"regexp"
)
@niratama
niratama / twpicdl.sh
Last active November 26, 2019 11:46 — forked from marbocub/twpicdl.sh
#!/bin/sh
# Modified by Stan Schwertly to download locally rather than to send to Posterous.
# Github: http://github.com/Stantheman/Twitpic-Backup
# Copyright 2010 Tim "burndive" of http://burndive.blogspot.com/
# This software is licensed under the Creative Commons GNU GPL version 2.0 or later.
# License informattion: http://creativecommons.org/licenses/GPL/2.0/
# This script is a derivative of the original, obtained from here:
@niratama
niratama / open-golang-test.go
Created August 24, 2014 06:39
goでhttpサーバ起動と同時にブラウザを開く例
package main
import (
"fmt"
"log"
"net/http"
"github.com/skratchdot/open-golang/open"
)