Skip to content

Instantly share code, notes, and snippets.

View ytnobody's full-sized avatar
♨️
470

ytnobody / satoshi azuma ytnobody

♨️
470
View GitHub Profile
@DavidWells
DavidWells / aws-lambda-redirect.js
Created June 28, 2018 20:48
How to do a 301 redirect from an AWS lambda function
exports.handler = (event, context, callback) => {
const response = {
statusCode: 301,
headers: {
Location: 'https://google.com',
}
};
return callback(null, response);
}
@nekoruri
nekoruri / docker_memo.md
Last active August 29, 2015 14:10
Dockerに関するメモ
@hayajo
hayajo / 00.md
Last active March 8, 2020 16:05
NDS#36 Go言語入門
@tsucchi
tsucchi / .replyrc
Created March 14, 2014 03:36
replyでOtogiri使う
script_line1 = use strict
script_line2 = use warnings
script_line3 = use 5.018002
script_line4 = use Otogiri;
script_line5 = use Otogiri::Plugin;
script_line6 = my $connect_info = ["dbi:...",'username','password', { AutoCommit => 1, RaiseError => 1,PrintError => 0, pg_enable_utf8 => 1,}];
script_line7 = Otogiri->load_plugin('DeleteCascade');
script_line8 = my $db = Otogiri->new( connect_info => $connect_info );
[Interrupt]
@Shinpeim
Shinpeim / 00.md
Last active January 16, 2020 13:08
Scala 入学式の資料

Better Java としての Scala

Hello World

  • src/main/scala/Main.scala
object Main {
  def main(args: Array[String]): Unit = {
    println("hello scala!")
@Shinpeim
Shinpeim / 000.md
Last active January 22, 2022 07:31
プロセスとかスレッドとかプロセス間通信とかについて書く場所

重要

サイズがあまりに大きくなってしまったので、gist ではなくて github 上で管理するようにしました。

https://github.com/Shinpeim/process-book

URL 変わっちゃうの申し訳ないんだけど、一覧性が高くなるのと pull req が受け取れるメリットのほうを取ります。せっかく読みにきてくれたのにひと手間かかっちゃってすみません。

この文書の目的

@walkure
walkure / jma_push_subscriber_sample.pl
Last active December 10, 2015 21:28
気象庁の防災情報PuSH試行試行配信を受信するサブスクライバCGIの例 (cf. http://d.hatena.ne.jp/W53SA/20130109/1357750514 )
#!/usr/bin/env perl
#cf. http://d.hatena.ne.jp/W53SA/20130109/1357750514
use strict;
use LWP::Simple;
use XML::Atom::Feed;
use URI;
use File::Basename;
use Digest::HMAC_SHA1;
@kkotaro0111
kkotaro0111 / analyvote.js
Created December 17, 2012 02:55
読売新聞サイトの選挙速報の比例代表ページから、各政党ごとに獲得票数を合計し、その獲得率を計算するスクリプト http://www.yomiuri.co.jp/election/shugiin/2012/ にアクセスし、コンソールなどに入力して使う。あくまで比例区のみの話なので、小選挙区も含めた最終的な結果とは比較してはいけない。
//12/17 11:30頃に確認した結果
//自由民主党 16,624,457票 27.62% 57議席 31.66%
//日本維新の会 12,262,228票 20.37% 40議席 22.22%
//民主党 9,628,653票 15.99% 30議席 16.66%
//公明党 7,116,474票 11.82% 22議席 12.22%
//みんなの党 5,245,586票 8.71% 14議席 7.77%
//日本共産党 3,689,159票 6.13% 8議席 4.44%
//日本未来の党 3,423,915票 5.68% 7議席 3.88%
//社会民主党 1,420,790票 2.36% 1議席 1.11%
//新党大地 346,848票 0.57% 1議席 1.11%
@moznion
moznion / gist:3599242
Created September 2, 2012 14:04
gitPullSuspender_proto
#!/usr/bin/perl
use strict;
use warnings;
use 5.012;
use WebService::Simple;
my $target_username = "plack"; # <= It's test var! Hehe. FIXME
my $target_reponame = "Plack"; # <= It's test var! Hehe. FIXME
@xtetsuji
xtetsuji / maillog-hashnize.pl
Last active October 11, 2022 08:08
enhancement of "pflog" for parsing maillog of postfix 2.3 or higher version.
#!/usr/bin/perl
# "pflog" enhancement for parsing maillog of postfix 2.3 or higher version.
# "pflog" see: http://www.tmtm.org/ruby/pflog/pflog-0.3
use strict;
use warnings;
use Time::Local;
use Getopt::Long;
#use Data::Dumper;