Skip to content

Instantly share code, notes, and snippets.

@masartz
masartz / app.psgi
Last active May 24, 2022 08:54
For Github webhook payload URL
use strict;
use warnings;
use utf8;
use Plack::Request;
use HTTP::Entity::Parser;
use Hash::MultiValue;
use JSON;
use Data::Dumper;
my $parser = HTTP::Entity::Parser->new;
@masartz
masartz / restrict_users.gs
Last active March 18, 2022 02:28
Restrict members & post violation to Slack
// Slackの Incoming webhooks の設定を済ませ、webhook URLを発行しておく
// ex: https://hooks.slack.com/services/AAAAA/BBBB/CCCC
const WEB_HOOK_URL = "";
// Slack通知時の設定
const SLACK_USER_NAME = 'bot user name';
const SLACK_ICON = ':hatching_chick:';
// 対象のコンテンツを選択: "document" or "spreadsheets"
const CONTENT_TYPE = "document";
@masartz
masartz / count_methods.go
Created February 20, 2022 09:22
Laravel のソースツリーをターゲットとして、Model classのメソッド数とその一覧を出力するためのスクリプト
package main
import (
"bufio"
"fmt"
"os"
"path/filepath"
"regexp"
)
@masartz
masartz / TrashDialogFlow.js
Last active December 22, 2017 09:43
TrashDialogFlow
'use strict';
const functions = require('firebase-functions');
const dayNames = [
'日曜日',
'月曜日',
'火曜日',
'水曜日',
'木曜日',
#!/usr/bin/env perl
use strict;
use warnings;
use File::Find;
use File::Slurp;
use Data::Dumper;
use List::MoreUtils;
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use File::Path;
use File::Slurp;
use JSON;
@masartz
masartz / pod_list
Last active December 17, 2015 04:39
view pod list
#!/usr/bin/env perl
use strict;
use warnings;
use Encode;
use Pod::Simple::PullParser;
use File::Slurp qw/ read_dir/;
use Text::Xslate;
use Plack::Response;
@masartz
masartz / app.rb
Created October 17, 2015 13:31
sinatra-formkeeper combination-diff
require 'sinatra/base'
require 'sinatra/formkeeper'
class MainApp < Sinatra::Base
register Sinatra::FormKeeper
post '/input' do
form do
filters :strip
field :username, :present => true, :length => 4..12
field :old_password, :present => true, :length => 8..16
@masartz
masartz / gist:630119
Created October 16, 2010 18:24
YAPC::Asia Qudo::Plugin::Logger&Qudo::Hook::Notify demo script
#!/usr/bin/perl
use strict;
use warnings;
use Qudo;
my $qudo = Qudo->new(
driver_class => 'Skinny',
databases => [+{
dsn => 'dbi:mysql:qudo',
@masartz
masartz / gist:630120
Created October 16, 2010 18:27
YAPC::Asia2010 Qudo::Hook::ForceQuitJob demo script
#!/usr/bin/perl
use strict;
use warnings;
use Qudo;
my $qudo = Qudo->new(
driver_class => 'Skinny',
databases => [+{
dsn => 'dbi:mysql:qudo',