Skip to content

Instantly share code, notes, and snippets.

@nowri
nowri / 0_reuse_code.js
Last active August 29, 2015 14:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
☆○○○について
2011/xx/xx isora1988
■ このプログラムは?
//< 概要を書く-----
■ 必要なもの
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 / ameblo_bookmarklet.js#bookmarkletsapi
Last active December 16, 2015 05:19 — forked from sugyan/ameblo_bookmarklet.md
アメブロ画像保存用ブックマークレット (forked from <a href="https://gist.github.com/sugyan/3977687">sugyan</a>)
javascript:(function(){window.open(document.getElementById('imgEncircle').firstChild.getAttribute('src')%2C'_blank')}())
@nowri
nowri / img_size_checker.js#bookmarkletsapi
Last active December 16, 2015 02:09 — forked from sacrifs/img_size_checker.js
HTMLで画像のサイズが実際のサイズと異なる場合に赤枠を付け、console.logに書き出しするブックマークレット用JS (forked from sacrifs)
javascript: (function(){
var d = window.document;
var s = d.createElement('script');
s.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js';
d.body.appendChild(s);
setTimeout(function(){
$("img").each(function(){
var src = $(this).attr("src");
var img = new Image();
img.src = src;