Skip to content

Instantly share code, notes, and snippets.

@minipai
minipai / AngularWay
Last active December 19, 2015 13:29
Refactor from Backbone to Angular.
window.commentsCtrl = ($http, $scope, $element)->
update = ()->
$http.get(location.pathname).success (result)->
$scope.comments = result.comments
update()
e$form = $element.find('form')
e$form.submit (e)->
e.preventDefault()
$.post(e$form.attr('action'), e$form.serialize(), ()->
@minipai
minipai / sample.md
Last active December 17, 2015 06:59

HTML A

<div class="box">
    <div class="box-title"></div>
    <div class="box-content"></div>
</div>

CSS A

 .box {...}
@minipai
minipai / gist:4161973
Created November 28, 2012 15:28
sublime-settings
{
"color_scheme": "Packages/Color Scheme - Default/Solarized (Light).tmTheme",
"draw_white_space": "all",
"file_exclude_patterns":
[
"*.pyc",
".DS_Store"
],
"folder_exclude_patterns":
[
@minipai
minipai / index.html
Created November 15, 2012 00:38
A CodePen by Art Pai. CSS Chrome-like tab
<div class="tabs">
<div class="tab"><div class="tab-box"></div></div>
<div class="tab"><div class="tab-box"></div></div>
<div class="tab active"><div class="tab-box"></div></div>
<div class="tab"><div class="tab-box"></div></div>
</div>
<div class="content">
</div>
@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;
@minipai
minipai / gist:3150020
Created July 20, 2012 10:18
Middleman 3 Template Layouts
title
Layouts &amp; Partials

Layouts

Layouts allow the common HTML surrounding individual pages to be shared across all your templates. The most basic layout has some shared content and a yield call where templates will place their contents. Furthermore, With wrap_layout, content_for and partial you can build a complex layout inheritance, reduce the duplication of you code in templates to a minimal amount.

Basic layout

@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 / 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 / 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 {