Skip to content

Instantly share code, notes, and snippets.

View aliyome's full-sized avatar

aliyome

View GitHub Profile
@aliyome
aliyome / form.md
Last active July 22, 2018 07:57
Angular form memo

Reactive Form sample

<textarea [formControl]="formControl" [maxlength]="length">
<span *ngIf="formControl.dirty"> dirty </span>
<button [disabled]="formControl.invalid">submit</button>

Custom Validator

@aliyome
aliyome / rx.js
Last active July 22, 2018 07:57
rxjs playground
// https://rxviz.com/v/7J2laXyo
var a = Rx.Observable
.interval(500)
.take(6)
.groupBy(x => x %2 === 0)
var b = a.flatMap(x => x)
var bb = a.mergeAll()
var sw = a.switchMap(x => x)
var exh = a.exhaustMap(x => x)
@aliyome
aliyome / ng-memo.md
Last active July 22, 2018 07:28
雑多

Redux(ngrxの流れ)

sequenceDiagram

participant Component
participant Action
participant Reducer
participant Store
participant Effect
@aliyome
aliyome / test.d
Last active July 22, 2018 07:27
黒魔術系
import std.stdio;
import std.traits;
import std.range;
import std.array;
import std.algorithm;
import core.sync.mutex;
class A {
private int private_field;
public string public_field;
@aliyome
aliyome / marshal.vb
Created August 1, 2016 07:16
GCHandleとMarshalについて迷ったらこれ
Imports System.Runtime.InteropServices
Module Module1
' int hoge(int val) { return val; }
<DllImport("ConsoleApplication2.dll", CallingConvention:=CallingConvention.Cdecl)>
Public Function hoge(val As Int32) As Int32
End Function
' int foo(int* val) { *val = *val + 200; return val; }

Rails概要 10%

  • Railsの各コンポーネント(ActiveRecordやActionPack)の説明や、MVCにおける基礎的な知識
    • ActiveRecord
    • ActionPack
      • Action Dispatch
      • Action Controller
    • Active Support Core Extensions
      • blank? false, nil, 空白, 空の配列, 空のハッシュ, empty?
      • present?
  • presence nil or 実体
@aliyome
aliyome / air.d
Last active July 22, 2018 06:28
MUGEN air parser
import std.stdio;
import std.string : strip, toLower, format;
import std.conv : to;
import std.regex : ctRegex, matchFirst;
import std.file : readText;
import pegged.grammar;
mixin(grammar(`
Air:
import std.stdio, std.datetime, std.conv;
void main() {
auto t = Clock.currTime();
auto c = t.endOfMonth.day;
auto o = new Date(t.year, t.month, 1).dayOfWeek.to!int;
foreach (i; 0 .. o) {
write(" ");
}
foreach (i; 1 .. c + 1) {
writef("%2d", i);
import std.stdio;
import std.string;
import std.array;
import pegged.grammar;
import markdown;
mixin(grammar(MarkdownGrammar));
void main() {
auto doc = Markdown(sampleMd).children.front;
@aliyome
aliyome / calendar.d
Created October 22, 2014 10:32
プロ生のアレ
import std.stdio : write, writef, writeln;
import std.datetime : Clock, Date;
import std.conv : to;
void main() {
auto t = Clock.currTime();
auto count = t.endOfMonth.day;
auto offset = new Date(t.year, t.month, 1).dayOfWeek.to!int;
foreach (i; 0 .. offset) {