Skip to content

Instantly share code, notes, and snippets.

View suzuken's full-sized avatar

Kenta SUZUKI suzuken

View GitHub Profile
<?php
/**
*
*/
class testTriangle extends PHPUnitTestCase
{
public function set_up()
{
}
<?php
/**
* 三角形の判定
*/
function triangle($a, $b, $c){
if (!isValid($a) || !isValid($b) || !isValid($c)){
return false;
}
if (!isTriangle($a, $b, $c)) {
<?php
require_once 'triangle.php';
class TriangleTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
echo "hoge";
}
@suzuken
suzuken / ecnavi.vim
Created August 20, 2012 14:19
ecnavi-vim-for-demo
" vim:set ts=2 sts=2 sw=2 tw=0:
scriptencoding utf-8
function! s:ecnavi_list(arg)
let winnum = bufwinnr(bufnr('^Ecnavi$'))
if winnum != -1
if winnum != bufwinnr('%')
exe winnum 'wincmd w'
endif
else
@suzuken
suzuken / TLU.py
Created September 24, 2012 13:00
Threshold Logic Unit
class TLU:
def __init__(self, threshold, weights):
self.threshold = threshold
self.weights = weights
pass
def fire(self, inputs):
t = 0
t = sum([self.weights[i] for i in range(len(self.weights)) if inputs[i] is True])
(use slib)
(require 'trace)
(define (factorial n)
(define (factorial n)
(if (= n 1)
1
(* n (factorial (- n 1)))))
(factorial n))
(trace factorial)
@suzuken
suzuken / gist:6808612
Created October 3, 2013 11:53
gitのalias 参考サイトもみてください
[alias]
# http://oli.jp/2012/git-powerup/
# http://blog.blindgaenger.net/advanced_git_aliases.html
alias = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\\t => \\2/' | sort
b = branch -a
br = browse-remote
ci = commit
co = checkout
d = diff
dc = diff --cached
@suzuken
suzuken / slide.md
Created October 5, 2013 13:18
slide_livecoding

はじめまして

  • 鈴木健太 (@suzu_v) と申します
  • 株式会社VOYAGE GROUP
    • 新卒2年目です
  • アドテクノロジー関連事業をしています
  • 普段はcosmiというデータをマネジメントするプラットフォームを開発しています

本日のメンバー

package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(1)
for i := 0; ; i++ {
package main
import "code.google.com/p/go-tour/pic"
func Pic(dx, dy int) [][]uint8 {
rec := make([][]uint8, dy)
for i := 0; i < len(rec); i++ {
x := make([]uint8, dx)