Skip to content

Instantly share code, notes, and snippets.

View fand's full-sized avatar
💭
🔪

AMAGI / Jun Yuri fand

💭
🔪
View GitHub Profile
@fand
fand / main.c
Last active December 28, 2015 12:38
C言語テストごっこ
#include <stdio.h>
#include "tester.h"
int test1();
int test2();
int test3();
int main ()
{
test_start();
@fand
fand / scheme.coffee
Last active December 29, 2015 17:29
((coffeescriptで) 書く (Lisp) インタプリタ)
#!usr/bin/env coffee
# coding: utf-8
##########################
# Utilities
##########################
type = do ->
classToType = {}
for name in 'Boolean Number String Function Array Date RegExp Undefined Null'.split(' ')
@fand
fand / test.coffee
Created November 29, 2013 10:42
((coffeescriptで) 書く (Lisp) インタプリタ) テスト
#!usr/bin/env coffee
# coding: utf-8
scheme = require './scheme.coffee'
##########################
# Tests
##########################
repl = scheme.repl
assert = (a,b) -> if a == b then console.log("ok") else console.log("ng\t a: " + a + "\t b: " + b)
@fand
fand / tempclass.cpp
Last active December 30, 2015 02:59
include .cpp to .hpp in C++ template class
#include <iostream>
template<class T>
TempClass<T>::TempClass(){
std::cout << "new" << std::endl;
}
template<class T>
TempClass<T>::~TempClass(){
std::cout << "delete" << std::endl;
@fand
fand / gist:8318958
Created January 8, 2014 15:53
Delay effect in Web Audio API, but it kills Chrome...
class @FX
constructor: (@ctx) ->
@in = @ctx.createGain()
@in.gain.value = 1.0
@out = @ctx.createGain()
@out.gain.value = 1.0
@view = new FXView(this)
connect: (dst) -> @out.connect(dst)
disconnect: () -> @out.disconnect()
@fand
fand / gist:8325352
Created January 8, 2014 22:07
Panner node alternative for Web Audio API
class @Panner
constructor: (@ctx) ->
@in = @ctx.createChannelSplitter(2)
@out = @ctx.createChannelMerger(2)
@l = @ctx.createGain()
@r = @ctx.createGain()
@in.connect(@l, 0)
@in.connect(@r, 1)
@l.connect(@out, 0, 0)
@r.connect(@out, 0, 1)
➜ Epic git:(es6-omikuji) ✗ for char in {a..z}; do; which $char; done;
a: aliased to atom-beta .
b not found
c not found
d: aliased to dirs -v | head -10
e: aliased to /usr/local/bin/emacs -nw
f not found
g: aliased to git
h not found
i not found
@fand
fand / line.pl
Created January 23, 2016 12:01
指定した行抜き出す君
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
my $line = $ARGV[0];
my $margin = $ARGV[1] // 0;
open my $dst, '|-', "head -n @{[$line + $margin]} | tail -n @{[$margin * 2 + 1]}";
#!/bin/sh
npm i -g nwb budo http-server pm2 forever nodemon
npm i -g strongloop
npm i -g gulp grunt-cli
npm i -g yo yeoman generator-eslint
npm i -g react babel babel-cli babel-preset-stage0 babel-preset-es2015
npm i -g eslint eslint-plugin-react eslint-plugin-html eslint-plugin-fand babel-eslint
npm i -g browserify watchify babelify tsify node-emoji mocha fixpack dtsm david lodash
npm i -g electron electron-prebuilt electron-packager
@fand
fand / ane.js
Created January 28, 2016 02:56
var Progress = require('progress');
var bar = new Progress('姉ing [:bar] :percent', { complete: '姉', incomplete: ' ', width: 20, total: 100 });
setInterval(() => bar.tick(1), 50);