Skip to content

Instantly share code, notes, and snippets.

@yusugomori
yusugomori / jFBMobileFeedPhoto.js.coffee
Created September 8, 2012 06:19
jFBMobileFeedPhoto.js.coffee
###!
* jFBMobileFeedPhoto.js
*
* @version 1.0.2
* @author Yusuke Sugomori
* @license http://yusugomori.com/license/mit The MIT License
*
* More details on github: https://github.com/yusugomori/jFBMobileFeedPhoto
###
@yusugomori
yusugomori / landscape.js.coffee
Created September 17, 2012 03:56
landscape.js.coffee
class Landscape
constructor: (options={}) ->
$('body').css visibility: 'hidden'
@isPortraitActivated = false
@isLandscape = false
@winWidth = 0
@clientHeight = 0
@clientWidth = 0
@maxWidth = 0
@yusugomori
yusugomori / landscape.html.slim
Created September 17, 2012 04:00
landscape.html.slim
#Landscape
#wrapper
.view-host
//.view.full-image
= image_tag "/path/to/img"
.view.page
p page
.view.page
p page
@yusugomori
yusugomori / landscape.css.less
Created September 17, 2012 04:02
landscape.css.less
@import "bootstrap/bootstrap";
@ratio: 1.1985;
@w: 480px;
body {
min-height: 100%;
overflow: hidden;
}
@yusugomori
yusugomori / iphone.js.coffee
Created September 21, 2012 17:35
iphone.js.coffee
class iPhoneTouchScroll
constructor: () ->
@clientHeight = 0
@preserveHeight = 0
@onTouchCurrent = {x:0, y:0}
@onTouchStart = {x:0, y:0}
@onTouchDrag = {x:0, y:0}
@onTouchDragThres = 5
# @onTouchScrollThres = 0
@onTouchScrollThres = 50
@yusugomori
yusugomori / capitalize.js
Created October 29, 2012 09:20
capitalize.js
String.prototype.capitalize = function() {
return this.slice(0, 1).toUpperCase() + this.slice(1).toLowerCase();
};
console.log('hElLo'.capitalize()); // Hello
@yusugomori
yusugomori / RestrictedBoltzmannMachine.py
Last active December 6, 2021 21:07
Restricted Boltzmann Machine (RBM) using Contrastive Divergence
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Restricted Boltzmann Machine (RBM)
References :
- Y. Bengio, P. Lamblin, D. Popovici, H. Larochelle: Greedy Layer-Wise
Training of Deep Networks, Advances in Neural Information Processing
Systems 19, 2007
@yusugomori
yusugomori / LogisticRegression.py
Last active March 30, 2021 00:03
multiclass Logistic Regression
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Logistic Regression
References :
- Jason Rennie: Logistic Regression,
http://qwone.com/~jason/writing/lr.pdf
@yusugomori
yusugomori / DeepBeliefNets.py
Last active March 7, 2022 08:40
Deep Belief Nets (DBN)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Deep Belief Nets (DBN)
References :
- Y. Bengio, P. Lamblin, D. Popovici, H. Larochelle: Greedy Layer-Wise
Training of Deep Networks, Advances in Neural Information Processing
Systems 19, 2007
@yusugomori
yusugomori / svm.py
Created January 18, 2013 16:02 — forked from mblondel/svm.py
# Mathieu Blondel, September 2010
import numpy as np
from numpy import linalg
import cvxopt
import cvxopt.solvers
def linear_kernel(x1, x2):
return np.dot(x1, x2)