Skip to content

Instantly share code, notes, and snippets.

var AnimationRegion = Backbone.Marionette.Region.extend({
innerRegionSelector: '.inner-page-region',
setLayout: function(layout, animationClass) {
this.regionAnimationClass = animationClass;
if (this.currentLayout) {
this.swap(layout);
} else {
var AppConstants = require('../constants/AppConstants.js');
var AppDispatcher = require('../dispatchers/AppDispatcher.js');
var api = require('../utils/api');
var ActionTypes = AppConstants.ActionTypes;
module.exports = {
create_customer: function(data){
api.customer.create(data);
}
@cgrand
cgrand / transmogrify.clj
Last active August 29, 2015 14:18
transmogrify->> rewrites last-threaded forms to use transducers.
(defmulti transmogrify
"Rewrites the last form of a thread-last to use transducer (if possible)."
(fn [f xform src & args] f))
(defmacro transmogrify->>
"Like ->> but uses transducers"
([x] x)
([src & xs]
(let [end (last xs)
xforms (butlast xs)
@caasi
caasi / Container.jsx
Last active August 29, 2015 14:19
another Container inspired by AltContainer
import React from 'react';
import { PureRenderMixin } from 'react/addons';
import ListenerMixin from 'alt/mixins/ListenerMixin';
import { keys, isArray } from 'lodash-compat';
var Container = React.createClass({
mixins: [PureRenderMixin, ListenerMixin],
getDefaultProps() {
return {
stores: {},
require "rubygems"
require "rbosa"
require "cgi"
require "htmlentities"
require 'iconv'
OSA.utf8_strings = true
evernote = OSA.app('Evernote')
coder = HTMLEntities.new
@maylogger
maylogger / self-clear.scss
Created March 16, 2011 17:20
用 scss 寫出一個 ie 也沒問題的 self-clear
@mixin self-clear {
clear: both;
&:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
*:first-child+html & { min-height: 1px; } // hack ie7
@AdamBrodzinski
AdamBrodzinski / compass-retina-sprites.scss
Created August 10, 2012 00:17 — forked from thulstrup/compass-retina-sprites.scss
Using Compass to generate normal and retina sprite maps
@import "compass/utilities/sprites"; // Include compass sprite helpers
@import "compass/css3/background-size"; // Include helper to calc background size
@mixin sprite($name, $hover: false, $active: false) {
@include retina-sprite($name, $sprites, $sprites2x, $hover, $active);
}
// The general purpose retina sprite mixin.
//
@ianstormtaylor
ianstormtaylor / base.router.js
Created September 19, 2012 04:16
Enhanced Backbone Router to make a lot of things easier.
define([
'underscore',
'backbone'
],
function (_, Backbone) {
return Backbone.Router.extend({
// Variants of the routes to be automatically bound to. This way you
@Rplus
Rplus / svg.md
Last active November 15, 2015 22:01
SVG it !

伸縮自在的愛

using svg automaticly generate fonts by gulp-iconfont

獵人動畫中的小傑在天空競技場,被西索誤導欺騙,臉頰因而黏上西索招牌念能力「伸縮自在的愛」的 Q 版畫面

這篇主要是要講如何使用 SVG 圖檔來生成 icon font,
並且要讓這 icon font 能順利在 CSS preprocessor tool 下接軌

目前 github demo repo 是使用 stylus preprocessor