Skip to content

Instantly share code, notes, and snippets.

apple-gcc42
autoconf
automake
bison
boost
boost-build
boot2docker
brew-cask
cmake
curl
@naotone
naotone / gulpfile.js
Last active August 29, 2015 14:01
gulpfile.js
//npm install --save-dev gulp gulp-watch gulp-livereload gulp-header gulp-concat gulp-coffee gulp-compass gulp-minify-css gulp-notify gulp-uglify gulp-order gulp-ruby-sass
var gulp = require('gulp'),
watch = require('gulp-watch'),
livereload = require('gulp-livereload'),
header = require('gulp-header'),
concat = require('gulp-concat'),
coffee = require('gulp-coffee'),
compass = require('gulp-compass'),
minifyCSS = require('gulp-minify-css'),
@naotone
naotone / brewfile
Last active August 29, 2015 13:58
brewfile
tap phinze/homebrew-cask
update
install brew-cask
install zsh
install ag
install apple-gcc42
install autoconf
install automake
install boost
@naotone
naotone / jQuery hover for appended objects.coffee
Last active December 17, 2015 12:59
jQuery hover for appended objects
jQuery('.content').on('mouseover', ->
jQuery(this).stop().css(opacity: 0.3).animate
opacity: 0.8
, 300
).on 'mouseout', ->
jQuery(this).stop().animate
opacity: 1
, 300
@naotone
naotone / retinacanvas.coffee
Created May 8, 2013 12:29
Optimize html5 canvas for retina display.
retinaCanvas = ->
if window.devicePixelRatio > 1
canvas.width = W * window.devicePixelRatio
canvas.height = H * window.devicePixelRatio
ctx.scale(window.devicePixelRatio, window.devicePixelRatio)
else
canvas.width = W
canvas.height = H
@naotone
naotone / hide_text_and_replace_Image.sass
Created April 24, 2013 03:29
Hide text and replace image mixin.
@mixin at2x($image_name, $extention: '.png')
background: image_url($image_name + $extention) no-repeat center center
background-size: image-width($image_name + $extention) image-height($image_name + $extention)
width: image-width($image_name + $extention)
height: image-height($image_name + $extention)
display: block
$x2img : $image_name + '@2x' + $extention
@media all and (-webkit-min-device-pixel-ratio : 1.5)
background-image: image_url($x2img)
background-size: image-width($image_name + $extention) image-height($image_name + $extention)
@naotone
naotone / iOSZoomDetect.js
Last active December 16, 2015 13:59
Hide position: fixed; elements after pinch zoom.
//Copyright 2013 NAOTONE
//Please use under MIT license.
jQuery(window).resize(function() {
iOSClearFixed();
});
jQuery('html').on("touchend", touchHandler);
touchHandler = function(event) {
return iOSClearFixed;
device = navigator.userAgent.toLowerCase()
Mac = device.match(/(mac)/)
Windows = device.match(/(windows)/)
iPhone = device.match(/(iphone|ipod)/)
iPad = device.match(/(ipad)/)
iOS = device.match(/(iphone|ipad|ipod)/)
android = device.match(/(android)/)