Skip to content

Instantly share code, notes, and snippets.

View kazu69's full-sized avatar
:octocat:
⭐️ 🚀 🍻 🍶

kazu69 kazu69

:octocat:
⭐️ 🚀 🍻 🍶
View GitHub Profile
@kazu69
kazu69 / backbone-test.html
Created May 26, 2012 06:54
Backbone.jsでのmodelのsaveイベントをsinonjsでテスト
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Backbone + sinon simple tests</title>
<script src="http://code.jquery.com/jquery-1.7.2.min.js" type="text/javascript"></script>
<script type="text/javascript" src='http://documentcloud.github.com/underscore/underscore-min.js'></script>
<script type="text/javascript" src='http://documentcloud.github.com/backbone/backbone.js'></script>
<script type="text/javascript" src='http://sinonjs.org/releases/sinon-1.3.4.js'></script>
<script src="https://raw.github.com/douglascrockford/JSON-js/master/json2.js" type="text/javascript"></script>
@kazu69
kazu69 / colum.scss
Created May 30, 2012 01:08
Grid.scss - Created based on the Twitterbootstrap
.colums {
@include columnContainer;
}
@for $i from 1 through $columns {
.colum#{$i} {
@include grid($i);
}
.offset#{$i} {
@include offset($i);
@kazu69
kazu69 / backboneView.js
Created June 27, 2012 10:57
Backviewでもdefault値を設定する例
var baseView = Backbone.View.extend({
defaults: {
defaulsVal: 'this is defaults'
},
initialize: function () {
_.defaults(this, this.defaults);
},
render: function () {
console.log(this.defaulsVal);
}
@kazu69
kazu69 / psedo-class
Created December 19, 2012 06:47
ie8 is not support nth-child(n) and last-chilad psedo class. i create sass psedo class mixin.
@mixin psedo-class($attr, $prop, $elem, $n:2) {
$elems: '';
@for $i from 1 through $n {
$elems: #{$elems} + #{$elem};
@if $i == $n {
.lt-ie9 &:first-child #{$elems} {
#{$attr}: #{$prop};
}
}
}
@kazu69
kazu69 / jquery-preload-images.coffee
Last active December 11, 2015 21:28
jQuery image preloader
images = [
image1.jpg,
image2.jpg,
image3.jpg,
image4.jpg
]
preload: (images, callback) ->
count = images.length
@kazu69
kazu69 / Gemfile
Last active December 12, 2015 09:28
rails+nginx+unicorn local develop env setting memo ref: http://oblog.objectclub.jp/nginxweb-5
# Your gem file Settings to take effect
# Use unicorn as the app server
gem 'unicorn'
# and bundle install Gem
doctype html
/[if lt IE 7]
| <html class="ie6">
/[if IE 7]
| <html class="ie7">
/[if IE 8]
| <html class="ie8">
/[if IE 9]
| <html class="ie9">
| <!--[if (gte IE 9)|!(IE)]<!--> <html> <!--<![endif]-->
"use strict";
var name = "foo";
var func = new Function(
"return function " + name + "(){ alert('sweet!')}"
)();
//call it, to test it
func();
@kazu69
kazu69 / bash.sh
Created March 14, 2013 15:50
Mac10.7 Mountain Lionでpstfixでエラー( postfix: fatal: chdir(/Library/Server/Mail/Data/spool): No such file or directory )が出たときの対応。
$ sudo mkdir -p /Library/Server/Mail/Data/spool
$ sudo /usr/sbin/postfix set-permissions
chown: /usr/share/man/man1/postalias.1.gz: No such file or directory
$ sudo /usr/sbin/postfix start
postfix/postfix-script: warning: group or other writable: /Library/Server/Mail/Data/mta
postfix/postfix-script: starting the Postfix mail system
$ sudo postfix check
postfix/postfix-script: warning: group or other writable: /Library/Server/Mail/Data/mta
@media all and (min-width:45em) {
body:after {
content: 'desktop';
display: none;
}