Skip to content

Instantly share code, notes, and snippets.

View hkitago's full-sized avatar

hkitago hkitago

  • Kawasaki
View GitHub Profile
@linuslundahl
linuslundahl / Ignore .DS_Store forever
Created September 13, 2010 09:55
Make git always ignore .DS_Store
$ git config --global core.excludesfile ~/.gitignore
$ echo .DS_Store >> ~/.gitignore
@mzp
mzp / echo.html
Created December 11, 2010 01:30
websocket.py
<html>
<head>
<style type="text/css">
.log {
color: red;
}
</style>
<script>
ws = new WebSocket("ws://localhost:8080");
ws.onopen = function (e) {
(function() {
var ImageTab, Tab, TabGroup, Window, log, tab1, tab2, tab3, tabGroup;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
}, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
@akisute
akisute / UIWebView+Additions.h
Created February 27, 2011 15:32
UIWebView addition to enable/disable scrolling
#import <UIKit/UIKit.h>
@interface UIWebView (Additions)
/*!
@abstract Enable/Disable the receiver from scrolling.
*/
@property (nonatomic, assign) BOOL webViewScrollEnabled;
@shin1x1
shin1x1 / sleepsort.php
Created May 20, 2011 01:32
sleep sort
<?php
$list = range(1,10);
shuffle($list);
foreach ($list as $i) {
$pid = pcntl_fork();
if ($pid === -1) {
die('fork error');
} else if ($pid === 0) {
@egraether
egraether / LICENSE.txt
Created May 24, 2011 15:28 — forked from 140bytes/LICENSE.txt
Pie Chart Timer
Copyright (c) 2011 Eberhard Gräther, http://egraether.com
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@terkel
terkel / jquery.placeholder.js
Created September 23, 2011 00:56
HTML5 Placeholder Polyfill using jQuery
(function ($) {
$(function () {
if (!supportsInputAttribute('placeholder')) {
$('[placeholder]').each(function () {
var $this = $(this),
$form = $this.closest('form'),
placeholderText = $this.attr('placeholder'),
placeholderColor = 'GrayText',
defaultColor = $this.css('color');
@thebigreason
thebigreason / social-sharing-alignment.html
Created October 18, 2011 17:48
Align Facebook Like, Twitter Tweet and Google +1 buttons
<div class="social">
<span class="twitter">
<a href="http://twitter.com/share" class="twitter-share-button" data-url="[your-url-here]">Tweet</a>
</span>
<span class="google">
<g:plusone size="medium" href="[your-url-here]"></g:plusone>
</span>
<span class="Facebook">
<iframe src="https://www.facebook.com/plugins/like.php?href=[your-url-here]&amp;show_faces=false&amp;layout=button_count" scrolling="no" frameborder="0" style="height: 21px; width: 100px" allowTransparency="true"></iframe>
</span>
@gre
gre / easing.js
Last active April 30, 2024 04:58
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
@mokemokechicken
mokemokechicken / install_opencv2.4_to_aws.markdown
Created May 15, 2012 21:46
Install OpenCV2.4 Into AWS(Amazon Linux AMI 2012.03)

Install OpenCV Into AWS

概要

これは、OpenCV の opencv_traincascade を マルチコアで高速に行うために, AWS EC2を使うための設定メモです。 EC2 の 「Amazon Linux AMI 2012.03」に OpenCV2.4.0 を TBB 付きでInstallします。 使い方のイメージは「HiCPUのEC2インスタンスで学習を実行し、実行結果のXMLをS3にUploadしたらEC2インスタンスをshutdownする」です。

なんか、色々非効率なことをしている部分もあると思いますが、ご了承ください。 ちなみに、このAMIイメージを選んだ理由は特にないです。