Skip to content

Instantly share code, notes, and snippets.

View masutaka's full-sized avatar

Takashi Masuda masutaka

View GitHub Profile
# frozen_string_literal: true
exit 0 unless ENV['CIRCLECI']
require_relative './github_updater'
require_relative './pushover_glue'
result = GithubUpdater.run
if result.count > 0
@masutaka
masutaka / .tmux.conf
Last active July 9, 2018 08:03
~/.tmux.conf
# moved to https://github.com/masutaka/dotfiles-public/blob/master/.tmux.conf
@masutaka
masutaka / 00sync.el
Created November 12, 2017 13:36
Introduce promise and async-await on emacs
(defun mstk-start-sync ()
(call-process "sh" nil nil nil "-c" "sleep 3; echo OK")
(message-box "mstk-start-sync finished."))
(mstk-start-sync)
@masutaka
masutaka / export.sh
Last active May 7, 2019 03:50
Export Slack custom emoji
#!/bin/sh
# You can get on https://api.slack.com/methods/emoji.list/test
endpoint='https://slack.com/api/emoji.list?token=<SECRET>&pretty=1'
json=$(curl -s $endpoint)
keys=$(echo $json | jq -r '.emoji | keys[]')
mkdir -p images
@masutaka
masutaka / main.c
Last active October 27, 2017 09:10
Closure sample of clang and golang
/* Closure sample */
#include <stdio.h>
typedef int anyFunc(void);
static int doTimes(anyFunc anything, int n);
int main(void)
{
@masutaka
masutaka / closure.go
Last active October 24, 2017 15:34
go memorize
// Memorize using closure
package main
import (
"fmt"
"time"
)
func urlFunc() func() string {
@masutaka
masutaka / 00before.el
Last active April 24, 2019 21:30
Generate helm-github-stars-cache-file asynchronously
(defun my-lisp-load (filename)
"Load lisp from FILENAME"
(let ((fullname (expand-file-name (concat "spec/" filename) user-emacs-directory))
lisp)
(when (file-readable-p fullname)
(with-temp-buffer
(progn
(insert-file-contents fullname)
(setq lisp
(condition-case nil
@masutaka
masutaka / hoge.go
Created September 22, 2017 06:24
Wonder of golang init()
package main
import "fmt"
// $ go build hoge.go
// $ nm -A hoge | grep main
func init() {
fmt.Println("init() 1st")
}
@masutaka
masutaka / test.go
Last active September 19, 2017 15:57
Maybe private method with golang
package main
import (
"fmt"
)
func main() {
fmt.Printf("main() in test.go\n")
new(Test).Hoge()
Test2.Hoge()
@masutaka
masutaka / parallels_v1.go
Last active October 16, 2017 00:35
Serial and parallel processings with ruby and golang
// parallels processing v1 (broken code)
package main
import (
"fmt"
"runtime"
"time"
)