Skip to content

Instantly share code, notes, and snippets.

View akkunchoi's full-sized avatar

Akiyoshi Tanaka akkunchoi

View GitHub Profile

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

@akkunchoi
akkunchoi / tidy-dom-xpath.php
Created October 6, 2012 00:55
create DOM through Tidy
<?php
$html = file_get_contents($argv[1]);
$dom = dom($html);
$xpath = new DOMXPath($dom);
foreach ($xpath->query('//a') as $e){
var_dump($e->nodeValue);
}
@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();
class CsvFileIterator implements \Iterator{
protected $in;
protected $fp;
protected $index;
protected $current;
public function __construct($in, $options = array()) {
$this->in = $in;
$this->options = array_merge(array(
'column_separator' => ','
), $options);
# 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 / hoge.html
Last active February 14, 2017 14:06
php tidy dom xpath
<html>
<section>hoge</section>
</html>