Skip to content

Instantly share code, notes, and snippets.

#
# Life Game by CoffeeScript
# @author yusugomori
# @license http://yusugomori.com/license/mit The MIT License
#
# Usage:
# <body><div id="lifegame"></div></body>
#
# $ ->
# L = new Lifegame()
@yusugomori
yusugomori / bpnn.rb
Created April 26, 2012 17:48
bpnn.rb
#!/usr/bin/env ruby -Ku
# -*- coding: utf-8 -*-
srand(0)
class BPNN
def initialize(ni, nh, no)
@ni = ni + 1
@nh = nh
@no = no
@yusugomori
yusugomori / bpnn.py
Created April 26, 2012 17:55
bpnn.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Originally from http://arctrix.com/nas/python/bpnn.py
import time, math, random
random.seed(0)
class BPNN:
def __init__(self, ni, nh, no):
###!
* jquery.pinterest.js - placing your images with Pinterest look
*
* @version 1.0.0
* @author yusugomori
* @license http://yusugomori.com/license/mit The MIT License
*
* More details on github: https://github.com/yusugomori/jQueryPinterest
###
@yusugomori
yusugomori / checkbox.css
Created May 10, 2012 14:43
checkbox hack
#checkbox {
display: none;
}
.toggle {
display: none;
}
#checkbox:checked ~ .toggle {
display: block;
@yusugomori
yusugomori / checkbox.html
Created May 10, 2012 14:50
checkbox hack
<label for="checkbox">PUSH</label>
<input type="checkbox" id="checkbox" name="checkbox" />
<div class="toggle">
toggled element
</div>
.arrow {
height:0px;
width:0px;
border-top:#fc0000 16px solid;
border-bottom:0px solid transparent;
border-left:8px solid transparent;
border-right:8px solid transparent;
}
@yusugomori
yusugomori / box.css
Created May 10, 2012 16:15
CSS SWITCH
/*
* <div class="face top"></div>
* <div class="face left"></div>
* <div class="face right"></div>
*/
.face {
position: absolute;
overflow: hidden;
}
.top {
@yusugomori
yusugomori / overlay.css
Created May 30, 2012 18:07
DOMWindowOverlay
/*
* HTML (created by javascript) will be like below.
*
* <div id="DOMWindowOverlay">
* <div id="DOMWindow">
* <div class="view">
* View contents come here.
* <div class="close">&times;</div>
* </div>
* </div>
@yusugomori
yusugomori / overlay.coffee
Created May 30, 2012 18:38
DOMWindowOverlay CoffeeScript
class DOMWindow
constructor: () ->
@DOMWindowOverlay = '#DOMWindowOverlay'
@_DOMWindowOverlay = @DOMWindowOverlay.replace(/^\#/,"")
@DOMWindow = '#DOMWindow'
@_DOMWindow = @DOMWindow.replace(/^\#/,"")
@Lightbox = ".view"
render: () ->