Skip to content

Instantly share code, notes, and snippets.

View matsumotius's full-sized avatar

Matsumoto Akihiro matsumotius

View GitHub Profile
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+TAjwXToXWGqT0uUbbNks3MVivAyWyyjiQIS3dX9DEu+HaOdG8uyugAaBr7xIeReKwGpbdwEidE5heNhjX9Z25sNGDfUr0WjICHArJYPbITO05/DVd81SXnZY2fKKTj9BZodTl0nTfS9cJ1mR7TRzWHuSzoYfd2wQYMcSOs32pTmLC0X4hH6LNlFKGxtQwDjV1Qx0hvRSWIWkDh0WMj2+qxtS5531MPHqyWvYHmNxZ1MQyEt19H7QhhXCNKC19019JBXhvBflehOC0wzjnq1wN8GWgB3Fq+jHZ3pUNKSO9+1Ovw7RcvH3lg7Xxun1mL4RM9vn6HMKFjBqcNkuE123 matsumotius@ubuntu
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCv4jWecXDMmo/to6dOhYqkEMYq7hoQZzkHrISnbKQ9oyq/T+szouR8nkjqoWWMBAWpWI6sRmxQYai0lPBh3NuR0vOJ8X3b5jqG6MeMRWismCCPfoP0lFbNQ4yBeIp0Q7PnpFoCwEzUoLDK+OLZELTn6VxdGRvBJqo7sHH7K0+DM4OBryamDTHk7P3cw+CCInp3lmOyu7kVk2bDsIp7nvJnzJtvdAf5HqMt1tmZZc14YAOMMQs4Mcy20pjmx9P5RGPRaUkYku3PQbmzA4KcRAagAgXGSVA9O6dtgIYIvJn9Aah0ryIsUDVQpxID1+08c1WMg+05PGA86hrlOL84Ho8r [email protected]
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
maven {
url 'https://raw.github.com/ark/ark/master/releases/'
}
}
dependencies {
apply plugin: 'android'
apply plugin: 'android-apt'
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 9
targetSdkVersion 14
@matsumotius
matsumotius / focus.js
Created September 2, 2012 23:34
set focus color
(function($){
$.fn.colorFocus = function(color, trigger){
var defaultColor = $(this).css('background-color');
var hasTrigger = (typeof trigger == 'function');
$(this).mouseover(function(e){
if (hasTrigger && false == trigger(this)) return;
$(this).css('background-color', color);
});
import scala.collection.mutable.HashMap
class HuffmanTree(str: String) {
abstract class Node {
val count: Int
}
case class Leaf(str:String, count:Int) extends Node
case class Branch(left: Node, right: Node) extends Node {
val count = left.count + right.count
}
@matsumotius
matsumotius / ht.js
Created June 4, 2012 18:27
huffman tree
var Node = function(value, left, right, word){
this.value = value;
this.left = left;
this.right = right;
this.word = word;
};
var HuffmanTree = function(wordcount){
this.list = [];
for (var word in wordcount) {
this.list.push(new Node(wordcount[word], null, null, word));
@matsumotius
matsumotius / plugin.js
Created March 28, 2012 09:52
jQuery plugin sample
(function($) {
/* extend jQuery */
$.fn.yellow = function(options) {
$(this).css('background-color', 'yellow');
return "plugin test";
};
})(jQuery);
@matsumotius
matsumotius / app.js
Created March 1, 2012 22:35
get session from socket.io
var express = require('express');
var parse_cookie = require('connect').utils.parseCookie;
var MemoryStore = express.session.MemoryStore;
var session_store = new MemoryStore();
var app = module.exports = express.createServer();
app.configure(function(){
app.use(express.bodyParser());
app.use(express.cookieParser());
app.use(express.methodOverride());