Skip to content

Instantly share code, notes, and snippets.

@minipai
minipai / CoffeeScriptSong.md
Last active August 29, 2015 13:56
Song of CoffeeScript "Let It(Semicolon) Go"

Let It(Semicolon) Go

The snow glows white on the mountain tonight

Not a footprint to be seen

A kingdom of isolation,

And it looks like I’m nobody.

@minipai
minipai / post-checkout
Created March 3, 2014 09:24
Brach changed, do Gulp.
#! /bin/bash
# Exit early if this was only a file checkout, not a branch change ($3 == 1)
[[ $3 == 0 ]] && exit 0
echo "Brach changed, do Gulp."
cd "$GIT_DIR/../biideal/static"
pwd
gulp
var mongoose = require( 'mongoose' )
, ObjectId = mongoose.Schema.Types.ObjectId
, Board = mongoose.model( 'Board' )
, BoardAdmin = mongoose.model( 'BoardAdmin' )
, Post = mongoose.model( 'Post' )
exports.show = function(req, res) {
var data = {}
$iphone-query = "only screen and (max-width: 480px)"
$ipad-query = "only screen and (min-width: 481px) and (max-width: 768px)"
$screen-query = "only screen and (min-width: 768px) and (max-width: 1300px)"
$wide-screen-query = "only screen and (min-width: 1301px)"
$tablet-query = "only screen and (max-width: 1024px)"
$mobile-query = "only screen and (max-width: 767px)"
$desktop-query = "only screen and (min-width: 768px)"
@minipai
minipai / express-renderReact.js
Created February 13, 2015 02:36
Express middleware to render react.js on server side, with react-router
var React = require('react');
var Router = require('react-router');
var DocumentTitle = require('react-document-title');
var reactRoutes = require('../view/_route.jsx');
var Html = require('../view/Html.jsx');
/**
* @name RenderView
* @constructor
@minipai
minipai / unsemantic.css
Created November 3, 2010 11:06
unsemantic CSS
/* ========== */
/* = hide = */
/* ========== */
.hide {
position: absolute;
left: -9999px;
}
.hide-text {
@minipai
minipai / col.css
Created November 3, 2010 10:53
CSS 2 col
/* css two col function */
.col2(@sider: 200px, @space: 20px) {
.sider {
background-color: #ddd; /* just for demo */
width: @sider;
float: left;
}
.content {
@minipai
minipai / Less Grid.less
Created December 24, 2010 06:08
960 style grid in LESS
@grid_width: 60px;
@grid_num: 12;
@gutter: 10px;
@total_width: (@grid_width + @gutter * 2) * @grid_num;
.grid_width (@grid_num: 1) {
width: (@grid_width + @gutter * 2) * @grid_num - @gutter * 2;
}
@minipai
minipai / stylecoder.rb
Created March 27, 2011 08:58
My HTML/CSS coding helper
require 'rubygems'
require 'sinatra'
require 'net/http'
get '/' do
@stylesheets = Dir.glob("public/css/*.css")
@erb = Dir.glob("views/*.erb")
@erb.delete('views/layout.erb')
@minipai
minipai / universal.css
Created November 12, 2012 10:54
Things It Might Be Fun/Useful to Try the Universal (*) Selector On from CSS-Tricks
* {
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
-ms-transition: all 0.2s ease;
-o-transition: all 0.2s ease;
}
* {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;