Skip to content

Instantly share code, notes, and snippets.

@nowri
nowri / FLAutoKerning.js
Last active August 29, 2015 13:59
FLAutoKerningを使いやすく拡張
/*
* @update 2014/03/07
* */
// ORIGINAL LICENCE
/*
* @class FLAutoKerning
* @version 0.0.3 (2011/02/28)
* @author Takayuki Fukatsu, artandmobile.com, fladdict.net
* @requires jQuery
*/
☆○○○について
2011/xx/xx isora1988
■ このプログラムは?
//< 概要を書く-----
■ 必要なもの
@nowri
nowri / minmax.js
Created March 19, 2014 04:05
リサイズ時にチラツキとレイアウト崩れが起こる現象などを改善
/**
* @license
* Lo-Dash 2.4.1 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
* Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js`
*/
;(function(){function n(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++t<e;)if(n[t]===r)return t;return-1}function r(n,r){for(var t=n.m,e=r.m,u=-1,o=t.length;++u<o;){var i=t[u],f=e[u];if(i!==f){if(i>f||typeof i=="undefined")return 1;if(i<f||typeof f=="undefined")return-1}}return n.n-r.n}function t(n){return"\\"+yr[n]}function e(n,r,t){r||(r=0),typeof t=="undefined"&&(t=n?n.length:0);var e=-1;t=t-r||0;for(var u=Array(0>t?0:t);++e<t;)u[e]=n[r+e];return u}function u(n){return n instanceof u?n:new o(n)}function o(n,r){this.__chain__=!!r,this.__wrapped__=n
}function i(n){function r(){if(u){var n=e(u);Rr.apply(n,arguments)}if(this instanceof r){var i=f(t.prototype),n=t.apply(i,n||arguments);return O(n)?n:i}return t.apply(o,n||arguments)}var t=n[0],u=n[2],o=n[4];return r}function f(n){return O(n)?Br(n):{}}func
@nowri
nowri / window load
Last active March 17, 2016 09:37
クロスブラウザDOMContentLoaded
var onReady = function(func){
function IEDOMContentLoaded(){
try {
(new Image()).doScroll();
func();
} catch(err) {
setTimeout(IEDOMContentLoaded, 64);
}
}
if (typeof window.getSelection === "function") {
@nowri
nowri / gist:8822666
Created February 5, 2014 12:33
JSによるスタイルの動的追加
/**
* Add style tag
*
* @param css ex.<code>"h1 { background: red; }"</code>
* @see http://stackoverflow.com/questions/524696/how-to-create-a-style-tag-with-javascript#answer-524721
*/
function addStyle(css) {
var head = document.getElementsByTagName('head')[0],
style = document.createElement('style');
style.type = 'text/css';
@nowri
nowri / gist:8821243
Last active August 29, 2015 13:56
先頭(前方)と末尾(後方)にある空白文字を一括削除
//@see http://www.nishishi.com/javascript/2013/trim-space-chars.html
TargetString = TargetString.replace(/(^\s+)|(\s+$)/g, "");
function getPrefix( prop ){
var vendorPrefixes = ['Moz','Webkit','Khtml','O','ms'],
style = document.createElement('div').style,
upper = prop.charAt(0).toUpperCase() + prop.slice(1),
pref, len = vendorPrefixes.length;
while( len-- ){
if((vendorPrefixes[len] + upper) in style){
pref = (vendorPrefixes[len]);
}
}
// Template
// (c) 2011 Jason Byrne, MileSplit
// May be freely distributed under the MIT license, with attribution.
//
// ** Usage **
//
// HTML:
// <script type="text/html" id="tmplArticle"><h1>${Title}</h1></script>
//
// JavaScript:
@nowri
nowri / template.jsx
Last active December 17, 2015 04:19
Photoshop / Illustrator CS6のjsx作成用テンプレート
// enable double-clicking from Mac Finder or Windows Explorer
#target photoshop
// #target illustrator
// #include "underscore.js"
// bring application forward for double-click events
@nowri
nowri / viewportFix.js
Last active December 16, 2015 15:39
densitydpiが端末ごとに異なるAndroid端末で横幅ピッタリに設定するためのもの。
$(function() {
//fix width on rotate phone
$(window).on('resize load', function(){
$("html").css("zoom" , $(window).width()/TARGET_WIDTH );
});
});