Skip to content

Instantly share code, notes, and snippets.

View Code-Hex's full-sized avatar
:shipit:
Go Travel

Kei Kamikawa Code-Hex

:shipit:
Go Travel
View GitHub Profile
@Code-Hex
Code-Hex / neovim.log
Last active April 25, 2020 07:25
Investigation for why causing kernel panic by nvim on macOS
PID/THRD RELATIVE ELAPSD CPU SYSCALL(args) = return
1448/0x4271: 5073 88 2 thread_selfid(0x0, 0x0, 0x0) = 17009 0
1448/0x4271: 5171 120 53 open(".\0", 0x0, 0x1) = 3 0
1448/0x4271: 5181 12 7 fstat64(0x3, 0x7FFEDFFFDD30, 0x0) = 0 0
1448/0x4271: 5189 10 4 fcntl(0x3, 0x32, 0x7FFEDFFFE400) = 0 0
1448/0x4271: 5196 9 5 close(0x3) = 0 0
1448/0x4271: 5236 43 39 stat64("/Users/codehex/go/src/github.com/neovim/neovim\0", 0x7FFEDFFFDCA0, 0x0) = 0 0
1448/0x4271: 5256 8 5 __mac_syscall(0x114943C3F, 0x5A, 0x7FFEDFFFDF00) = 0 0
1448/0x4271: 5289 5 1 shared_region_check_np(0x7FFEDFFFDD68, 0x0, 0x0) = 0 0
1448/0x4271: 5301 10 8 stat64("/private/var/db/dyld/dyld_shared_cache_x86_64h\0", 0x7FFEDFFFDCB0, 0x0) = 0 0
const { IncomingWebhook } = require('@slack/webhook');
const url = process.env.SLACK_WEBHOOK_URL;
const webhook = new IncomingWebhook(url);
// subscribeSlack is the main function called by Cloud Functions.
module.exports.subscribeSlack = (pubSubEvent, context) => {
const build = eventToBuild(pubSubEvent.data);
// Skip if the current status is not in the status list.
@Code-Hex
Code-Hex / checkout.sh
Last active February 27, 2020 09:15
useful checkout
git checkout $(git branch --sort=-authordate | perl -a -nle '$F[0] ne "*" and print $F[0]' | fzf)
/*
#!perl
#*/
package main;import("fmt");import("io/ioutil");
const(q=`/*
#!perl
#*/
package main;import("fmt");import("io/ioutil");
sub import{};
print "hello";
@Code-Hex
Code-Hex / main.dart
Created May 9, 2019 03:29
dart async sample
void main() async {
print(new DateTime.now());
String tm = await delayedTime();
print(tm);
}
Future<String> delayedTime() async {
Duration oneSecond = new Duration(seconds: 2);
return new Future.delayed(oneSecond, () {
return new DateTime.now().toString();
@Code-Hex
Code-Hex / oneliner.sh
Last active February 10, 2019 06:54
メルカリノベルティのワンライナー
#!/bin/bash
perl -e 'BEGIN{$^H{q}=sub{$_[0]=~y.Macir.Plr\0.r};$^H|=0x8000};print.0.00.qw.Just.and.0.00.print.32.97.110.111.116.104.101.114.32.q.Mercari.and.0.00.print.32.104.97.99.107.101.114.44'
# Just another Perl hacker,

Pods

1個以上のコンテナを走らす事ができる

ReplicaSets

同じ pod を指定した数だけ動かす。一つがダウンすると新しい pod が立つ

Secrets

@Code-Hex
Code-Hex / validaion_test.go
Last active August 10, 2018 13:17
Go, inteface type validation (channel and pointer of empty struct)
package main
import (
"reflect"
"testing"
)
type TS struct {
id int
name string
@Code-Hex
Code-Hex / sample_a.go
Last active April 15, 2018 04:37
Goroutine meets a signal @go Conference 2018 Spring
package main
import (
"fmt"
"os"
"os/signal"
"sync"
"syscall"
)
#! /usr/bin/perl
use strict;
use warnings;
use Fcntl qw(SEEK_SET);
use File::Temp qw(tempfile);
use Getopt::Long;
use Pod::Usage;
use Furl;