Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🔪

Takayosi Amagi fand

💭
🔪
View GitHub Profile
@fand
fand / main.c
Last active Dec 28, 2015
C言語テストごっこ
View main.c
#include <stdio.h>
#include "tester.h"
int test1();
int test2();
int test3();
int main ()
{
test_start();
@fand
fand / scheme.coffee
Last active Dec 29, 2015
((coffeescriptで) 書く (Lisp) インタプリタ)
View scheme.coffee
#!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 Nov 29, 2013
((coffeescriptで) 書く (Lisp) インタプリタ) テスト
View test.coffee
#!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 Dec 30, 2015
include .cpp to .hpp in C++ template class
View tempclass.cpp
#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 Jan 8, 2014
Delay effect in Web Audio API, but it kills Chrome...
View gist:8318958
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 Jan 8, 2014
Panner node alternative for Web Audio API
View gist:8325352
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)
View gist:9a70d1b2da20172517a0
➜ 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 Jan 23, 2016
指定した行抜き出す君
View line.pl
#!/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]}";
View newnode.sh
#!/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
View ane.js
var Progress = require('progress');
var bar = new Progress('姉ing [:bar] :percent', { complete: '姉', incomplete: ' ', width: 20, total: 100 });
setInterval(() => bar.tick(1), 50);
You can’t perform that action at this time.