Skip to content

Instantly share code, notes, and snippets.

View FiNGAHOLiC's full-sized avatar
🐰
Strugglin'

Yukihiko Okuyama FiNGAHOLiC

🐰
Strugglin'
  • Root Communications
  • Tokyo Japan
  • 23:35 (UTC +09:00)
View GitHub Profile
@FiNGAHOLiC
FiNGAHOLiC / gist:1416414
Created December 1, 2011 12:36 — forked from ehynds/widget-template.js
UI Widget Factory template
(function($){
$.widget("ui.mywidget", {
options: {
autoOpen: true
},
_create: function(){
// by default, consider this thing closed.
@FiNGAHOLiC
FiNGAHOLiC / apple-touch-startup-image.html
Created February 6, 2012 08:59
apple-touch-startup-image for iOS devices (CSS only solution)
<!-- 320x460 for iPhone 3GS -->
<link rel="apple-touch-startup-image" media="(max-device-width: 480px) and not (-webkit-min-device-pixel-ratio: 2)" href="startup-iphone.png" />
<!-- 640x920 for retina display -->
<link rel="apple-touch-startup-image" media="(max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)" href="startup-iphone4.png" />
<!-- iPad Portrait 768x1004 -->
<link rel="apple-touch-startup-image" media="(min-device-width: 768px) and (orientation: portrait)" href="startup-iPad-portrait.png" />
<!-- iPad Landscape 1024x748 -->
@FiNGAHOLiC
FiNGAHOLiC / LICENSE.txt
Created February 20, 2012 06:16 — forked from LeverOne/LICENSE.txt
generate random v4 UUIDs (107 bytes)
DO WTF YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Alexey Silin <pinkoblomingo@gmail.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WTF YOU WANT TO PUBLIC LICENSE
@FiNGAHOLiC
FiNGAHOLiC / deffered.js
Created March 14, 2012 07:28 — forked from lucasmazza/deffered.js
Animation chain using jQuery
// `then` isn't chainable, so we use `pipe`, which also accepts a 2nd callback for failure filters
// http://api.jquery.com/deferred.pipe/
$.Deferred(function(dfr) {
dfr
.pipe(function() { $('.first').fadeIn() })
.pipe(function() { $('.second').fadeIn() })
.pipe(function() { $('.third').fadeIn() })
}).resolve()
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
/**
* browser sinffing
* http://james.padolsey.com/javascript/detect-ie-in-js-using-conditional-comments/
*/
(function(){
var ie = (function(){
var undef,
v = 3,
div = document.createElement('div'),
@FiNGAHOLiC
FiNGAHOLiC / scaling_isomorphic_javascript_code.ja.markdown
Created March 21, 2012 17:43 — forked from tily/scaling_isomorphic_javascript_code.ja.markdown
サバクラ両方で動く JavaScript の大規模開発を行うために

サバクラ両方で動く JavaScript の大規模開発を行うために

原文:Scaling Isomorphic Javascript Code (This is just for study, please contact me at tily05 atmark gmail.com if any problem.)

考えてみれば Model-View-Controller とか MVC ってよく聞くよね。実際どんなものか知ってる? 抽象的に言うなら「オブジェクト情報の保持されるグラフィック・システム (つまり、ラスターではないグラフィック。ゲームとか) 上に構築された、表示系を中心としたアプリケーションにおいて、主要な機能どうしの関わりをうまく分離すること」とでも言おうか。もう少し深く考えを押し進めてみれば、これは当然、他のさまざまなアプリケーションにもあてはまる言葉 (bucket term ?) だ。

過去に多くの開発コミュニティが MVC による解決案を提供し、それによってよくあるユースケースにうまく対処し、地位を築くことができた。例をあげるなら、Ruby や Python コミュニティは Rails や Django を作り、MVC アーキテクチャを実現した。

@FiNGAHOLiC
FiNGAHOLiC / app.coffee
Created March 23, 2012 10:44 — forked from jondot/app.coffee
image-gallery
class Thumb extends Backbone.Model
defaults:
uri: ''
state: ''
select: (state) ->
st = ''
st = 'selected' if state
@set('state' : st)
@FiNGAHOLiC
FiNGAHOLiC / googlemaps.js
Created April 4, 2012 12:33 — forked from jasonwyatt/googlemaps.js
Google Maps RequireJS Module
(function(){
var callback = function(){},
callbackName = 'gmapscallback'+(new Date()).getTime();
window[callbackName] = callback;
define(['http://maps.googleapis.com/maps/api/js?sensor=true&callback=' + callbackName], function(){
return google.maps;
});
})();
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}