Instantly share code, notes, and snippets.

View cpanfile
requires "SQL::Translator::Producer::PlantUML";
requires "DBD::mysql";
View main.go
package main
import (
"log"
"github.com/hashicorp/hcl"
"github.com/k0kubun/pp"
)
type Config struct {
View search.pl
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
my $depth = 0;
my $str = "";
while (<>) {
if (/sqlt_deploy_hook\s+\{/) {
View cloud-config.yml
#cloud-config
write_files:
- path: /var/lib/iptables/rules-save
permissions: 0644
owner: root:root
content: |
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
View L2TP_IPSec_vpn_setup_for_centos7.sh
#!/bin/bash -x
# Description:L2TP/IPsec for CentOS7 64bit
# 2015/05/09 @mix3
(
## setting
cat << _SECRETS_ > /tmp/SECRETS_TMP.txt
#==============================================
# username auth_server password auth_ipaddress
View gist:27f0e7f593aacd9787e7
$ perl -MData::Dumper -e 'use utf8; local $Data::Dumper::Purity = 1; local $Data::Dumper::Terse = 1; local $Data::Dumper::Deepcopy = 1; local $Data::Dumper::Quotekeys = 0; local $Data::Dumper::Sortkeys = 1; print Dumper { "あ" => "い", "う" => "え" };'
{
  "\x{3042}" => "\x{3044}",
  "\x{3046}" => "\x{3048}"
}
View gist:075df9d988ce12fab143

例えばこういうのがあって

CREATE TABLE sample (
  id      BIGINT  unsigned NOT NULL auto_increment,
  type    TINYINT unsigned NOT NULL DEFAULT 0,
  body    TEXT             NOT NULL,
  is_read TINYINT unsigned NOT NULL DEFAULT 0,
  primary key (id)
) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4;
View gist:50d0a4f703707728a391
#!/bin/bash
LIB_DIR=~/.plenv/libs
PERL_VERSION=`plenv version | awk -v ORS='' '{print $1}'`
SS_DIR=`ls -alh $LIB_DIR | grep $PERL_VERSION | grep start_server | awk '{print $NF}'`;
SS_LIB=$LIB_DIR/$SS_DIR
if [ -e $SS_LIB ]; then
eval $(perl -Mlocal::lib=$SS_LIB)
start_server "$@"
View zoi_urls.pl
use 5.018;
use strict;
use warnings;
use utf8;
use Furl;
sub zoi_urls {
state $urls = do {
my $furl = Furl->new;
my @urls = ();
View runtime.stack.parse.go
package main
import (
"log"
"runtime"
"sync"
)
func goroutineId() string {
buf := make([]byte, 1024)