Skip to content

Instantly share code, notes, and snippets.

View akkunchoi's full-sized avatar

Akiyoshi Tanaka akkunchoi

View GitHub Profile
@akkunchoi
akkunchoi / class-validator.ts
Created May 16, 2019 08:04
class-validator groups, always
import "es6-shim";
import {IsNotEmpty, ValidateIf, IsOptional, Equals} from "../src/decorator/decorators";
import {Validator} from "../src/validation/Validator";
import {ValidatorOptions} from "../src/validation/ValidatorOptions";
import {expect, should, use } from "chai";
import * as chaiAsPromised from "chai-as-promised";
import { MinLength, ValidateNested } from "../src";
should();
# http://slang.kylestetz.com/
@bass (adsr (osc tri) 64n 2n 0.4 4n)
@synth (osc sine) + (gain 0.08)
@melody (osc saw) + (gain 0.08)
@drums (drums) + (gain 3)
@cdrums (drums) + (gain 1)
play @synth
function option(name: string): Function;
function option(target: any, propertyName: string, propertyDescriptor?: PropertyDescriptor): void;
function option(...args: any[]): Function|void {
if (args.length >= 2) {
_option(args[0], args[1], args[2]);
return;
} else {
console.log("evaluated", args);
return (...args2: any[]) => {
@akkunchoi
akkunchoi / cli-help.ts
Last active May 5, 2018 07:37
generate cli help from types
/**
*
* help({fileName: "", typeName: ""})
*
*/
import * as ts from "typescript";
interface HelpParameter {
fileName: string;
typeName: string;
@akkunchoi
akkunchoi / sequence.puml
Last active September 13, 2017 00:59
uml_sequence test
# http://uml.mvnsearch.org/gist/0795393d941ab558ba6df4a3ac16ecfd
@startuml
!define A A
!define B B
participant "Alice" as A
participant "Bob" as B
@akkunchoi
akkunchoi / wifi-slack.rb
Created March 28, 2016 09:53
特定のネットワークに入ったらSlackに投稿
# thanks to
# http://tech.actindi.net/3658802473
# http://yachibit.hateblo.jp/entry/2014/04/15/230301
require 'open-uri'
def hello
require 'date'
office = ['WIFI SSID']
path = '/Users/xxxxx/Dropbox/wifi-slack/last'
@akkunchoi
akkunchoi / async-parallelLimit.js
Created January 15, 2015 07:21
async parallelLimit
var async = require('async');
var _ = require('lodash');
var proc = _.range(1, 10).map(function(i){
console.log('init', i);
return function(callback){
console.log('start', i);
setTimeout(function(){
console.log('end', i);
callback(null, i);
@akkunchoi
akkunchoi / jquery.ticker.js
Created October 16, 2014 05:49
jquery.ticker.js
(function(){
/*
thanks to http://on-ze.com/archives/618, http://on-ze.com/archives/618
<div class="ticker" rel="fade"><!-- fade or roll or slide-->
<ul>
<li>テキスト1</li>
<li>テキスト2</li>
<li>テキスト3</li>
</ul>

Untitled Slide

Welcome to Glide.

Glide is the easiest way to create useful slide for all of your Gists.

  • input key <- to go backward.
  • input key -> to go forward.

Publishing

#!/bin/sh
function http_status(){
curl -LI $1 -o /dev/null -w '%{http_code}\n' -s
}
function alive(){
code=`http_status $1`
if [ "$code" != "200" ]; then
echo "$1 is $code!" | mail -s "[Alert] $1 is $code" sample@example.com
fi