Skip to content

Instantly share code, notes, and snippets.

View ilumin's full-sized avatar
🏠
Working from home

O Teerasak Vichadee ilumin

🏠
Working from home
  • Bangkok, Thailand
View GitHub Profile
@ilumin
ilumin / utilities-checkurl.js
Created March 11, 2012 19:13
Javascript: check url
function UrlExists(url) {
var http = new XMLHttpRequest();
http.open('HEAD', url, false);
http.send();
return http.status!=404;
}
@ilumin
ilumin / reset.css
Created April 16, 2012 16:39 — forked from terkel/reset.css
CSS: Reset
/*!
* CSS Reset 2011-12-25
* https://gist.github.com/gists/1360380
*
* Author: Takeru Suzuki, http://terkel.jp/
* License: Public domain
*
* Inspired by Normalize.css: http://necolas.github.com/normalize.css/
*/
@ilumin
ilumin / safe-console-log.js
Created January 11, 2013 03:21
usage: log('inside coolFunc', this, arguments); paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ make it safe to use console.log always
// usage: log('inside coolFunc', this, arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
log.history = log.history || []; // store logs to an array for reference
log.history.push(arguments);
if(this.console) {
arguments.callee = arguments.callee.caller;
var newarr = [].slice.call(arguments);
(typeof console.log === 'object' ? log.apply.call(console.log, console, newarr) : console.log.apply(console, newarr));
}
@ilumin
ilumin / gist:5159765
Created March 14, 2013 08:26
Install yeoman 1.0 in windows
> mkdir <your-project>
> cd <your-project>
Begin install
> npm install -g yo bower grunt-cli
Create new yeoman project
> yo webapp
Install dependencies
@ilumin
ilumin / gist:5213010
Created March 21, 2013 13:30
hover intent example
var showMenu = function(){
$(this)
.find(' > a')
.stop().animate({
backgroundColor: menuBGHilight,
color: menuColorHilight
}, 'fast');
$(this).find('.sub-navigator').length>0 &&
$(this).find('.sub-navigator').stop(true,true).slideDown(1000, 'easeInOutBack');
@ilumin
ilumin / gist:5244531
Created March 26, 2013 10:50
javascript for life of pi (http://journey.lifeofpimovie.com) ดู ศึกษา และเรียนรู้
/*
* life-of-pi-deconstructed - Micro site showing the making of the movie Life Of Pi.
*
*
* Build by Soap Creative (http://soapcreative.com)
* Version 0.1.0 (2013-03-15)
*
* Copyright (c) 2013 Fox
*/
var requirejs, require, define;
@ilumin
ilumin / index.html
Created April 12, 2013 02:49
A CodePen by katmai7. Simple check button - Design belongs: http://dribbble.com/shots/998387-Check-Buttons-PSD?list=popular&offset=81 Work perfectly only in Chrome!
<div class="wrap">
<div class="btn"><i class="icon-ok"></i></div>
<div class="btn active"><i class="icon-ok"></i>
</div>
</div>
@ilumin
ilumin / index.html
Created April 12, 2013 03:05
A CodePen by Tim Pietrusky. Kudos Please - A simple kudos widget without any external lib and it works with touch & mouse devices. Inspired by [dcurt.is](http://dcurt.is/).
<div class="kudos" data-amount="0" data-url="codepen.io/TimPietrusky/pen/acBCf"></div>
<footer>
2013 by
<a href="http://twitter.com/TimPietrusky" target="_blank">@TimPietrusky</a>
</footer>
@ilumin
ilumin / gist:5402538
Created April 17, 2013 07:56
HTML5 FileReader with multiple preview
<input type="file" id="collection" multiple /><br/>
@ilumin
ilumin / i18n-date.php
Created July 23, 2013 09:33
wordpress i18n date
<?php
/*
Plugin Name: i18n Date
Description: Can you read plugin name ?
Author: @ilumin
Version: 1.0
*/
function get_i18n_date($date_string, $date_format = false)
{