Skip to content

Instantly share code, notes, and snippets.

View tamanobi's full-sized avatar

Kohki YAMAGIWA tamanobi

  • CLIMT Inc.
  • Tokyo
View GitHub Profile
@heitorlessa
heitorlessa / example_minio_boto3.py
Created August 30, 2016 14:18
Minio with python boto3
# Sample as to how to initialize s3 client to work with Minio API compatible - https://github.com/minio/minio
# AWS CLI counterpart - https://docs.minio.io/docs/aws-cli-with-minio
import boto3
s3 = boto3.resource('s3',
endpoint_url='http://<minio_IP>:9000',
config=boto3.session.Config(signature_version='s3v4')
)
@yue82
yue82 / post_slack_prog_btn.py
Created July 8, 2016 16:53
Slack Progress Checker with Interactive Button
# -*- coding: utf-8 -*-
import requests
import json
from datetime import date
def make_month_prog_msg(work):
grades = ['B4', 'M1', 'M2']
month = date.today().month
return '{}さん,{}の進捗どうですか?'.format(grades[month%3], work)
@zonuexe
zonuexe / htmlsprintf.php
Last active January 22, 2019 10:55
どうしてもPHPからHTMLを出力せざるを得なくなったときにご利用ください
<?php
/**
* printf is template engine
*
* @license WTFPL http://www.wtfpl.net/
* @author USAMI Kenta <[email protected]>
* @param string $format
* @param string|int|float $args...
* @return string
Host handson
User admin
Port 22
IdentityFile インスタンスを作るときにダウンロードしたpemファイル
HostName パブリックIPアドレス
ServerAliveInterval 300
@masuidrive
masuidrive / main.js
Last active May 5, 2023 17:54
Google SpreadsheetからBigQueryを呼び出すスクリプト
/**
* Google Spreadsheet向けBigQuery取り込みスクリプト
* http://toreta.blog.jp/archives/20649904.html
* License: MIT 2014- Toreta, Inc.
*
* runAllQueries() をトリガーで毎日実行してください
* Queries, Single row queries, Dataの三つのシートを作って下さい
* Queries, Single row queriesのシートには実行するクエリを書きます
* A列にクエリ名、B列にクエリです。
* conuntなどの集約関数で1行しか返らないクエリは「Single row queries」、それ以外は「Queries」に書いて下さい
@Flafla2
Flafla2 / Perlin_Tiled.cs
Last active January 19, 2026 23:12
A slightly modified implementation of Ken Perlin's improved noise that allows for tiling the noise arbitrarily.
public class Perlin {
public int repeat;
public Perlin(int repeat = -1) {
this.repeat = repeat;
}
public double OctavePerlin(double x, double y, double z, int octaves, double persistence) {
double total = 0;
@abstractOwl
abstractOwl / index.html
Created July 11, 2014 06:54
Aspect-Oriented Programming Example. Live: http://jsfiddle.net/z8GXU/
<!DOCTYPE html>
<html lang="en">
<head>
<title>AOP Example</title>
<style type="text/css">
#log {
background: #EEE;
height: 300px;
overflow: auto;
}
lua有効のvim7.4をコンパイルインストールする
検証環境: CentOS6.4 64bit
インストール先
${HOME}/local/bin
luaソースファイル
http://www.lua.org/ftp/lua-5.2.3.tar.gz
UTF-8対応版?
@deris
deris / vim_keymapping.md
Created May 2, 2013 10:01
vimで使うキーの機能使用頻度と打ちやすさの整理

vimで使うキーの機能使用頻度と打ちやすさの整理

vimで使うキーの機能使用頻度と打ちやすさを整理してみました。 今回整理したのはnormalモードについてだけです。 機能の使用頻度と打ちやすさは、完全に個人の見解です。 キーボードによっても打ちやすさは変わると思います。

すべてのキーを網羅しているわけではありません。

@seraphy
seraphy / makeColor.java
Created July 26, 2012 10:01
連続する数値から割り当てる色を算定する。 色相を1周7分割し、1周ごとに最大4周まで彩度・明度を暗くする。
/**
* 連続する数値から割り当てる色を算定する.<br>
* @param sequence シーケンス番号
* @return 割り当てられた色
*/
protected Color makeColor(int sequence) {
int pos = sequence % 7; // 色相を7分割で1周
int lev = sequence / 7; // 周数
lev = lev % 4; // 4段階以上は暗くせず、最初に戻る.