Skip to content

Instantly share code, notes, and snippets.

@alivedise
alivedise / jquery.ba-tinypubsub.js
Created January 9, 2012 05:33 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
@alivedise
alivedise / gist:1712804
Created January 31, 2012 20:46
Test of mxui/layout/fill in gist
steal('jquery/dom/dimensions', 'jquery/event/resize').then(function( $ ) {
//evil things we should ignore
var matches = /script|td/,
// if we are trying to fill the page
isThePage = function( el ) {
return el === document || el === document.documentElement || el === window || el === document.body
},
//if something lets margins bleed through
bleeder = function( el ) {
◎鯨向海 〈復仇術〉
他說:
「不要再打電話來了。」
此後,花費長長的一生
想要忘記他的命令。
夏天的蕈狀雲轟炸這城市的時候
走到街角
想像所有的冰淇淋都排著隊
@alivedise
alivedise / JavaScriptMVC.md
Created February 1, 2012 18:14 — forked from jupiterjs/JavaScriptMVC.md
[翻譯] JavaScriptMVC 導覽

介紹

JavascriptMVC (JMVC)是一個基於jQuery的開放原始碼js框架。 它擁有完整的前端框架解決方案,包含打包工具,測試,代碼依賴管理,文件化,以及附帶許多有用的jQuery外掛。

JavascriptMVC的每一個項目都可以被獨立使用而不需要依賴其他項目。只看Class, Model, View, Controller部分的大小壓縮過只有7k左右,而且這之中的任何一個都還是能被獨立使用。 JavasriptMVC的輕巧及強大的獨立性使得它能應付複雜的大型web專案。

這個章節 只會 提到JavaScriptMVC的$.Class, $.Model, $.View, 和$.Controller. 下列是它們各自的敘述:

git submodule add git@github.com:_YOU_/steal.git steal
git submodule add git@github.com:_YOU_/jquerymx.git jquery
git submodule add git@github.com:_YOU_/funcunit.git funcunit
git submodule add git@github.com:_YOU_/documentjs.git documentjs
@alivedise
alivedise / $.Controller.md
Created February 2, 2012 03:30 — forked from jupiterjs/$.Controller.md
$.Controller for Alex MacCaw's Book

TODOS:

  • show .models() method and hookup

$.Controller - jQuery plugin factory

JavaScriptMVC's controllers are many things. They are a jQuery plugin factory. They can be used as a traditional view, making pagination widgets and grid controls. Or, they can be used as a traditional controller, initializing and controllers and hooking them up to models. Mostly, controller's are a really great way of organizing your application's code.

Controllers provide a number of handy features such as:

@alivedise
alivedise / $.Controller.md
Created February 7, 2012 01:29 — forked from jupiterjs/$.Controller.md
$.Controller for Alex MacCaw's Book

TODOS:

  • show .models() method and hookup

$.Controller - jQuery plugin factory

JavaScriptMVC's controllers are many things. They are a jQuery plugin factory. They can be used as a traditional view, making pagination widgets and grid controls. Or, they can be used as a traditional controller, initializing and controllers and hooking them up to models. Mostly, controller's are a really great way of organizing your application's code.

Controllers provide a number of handy features such as:

@alivedise
alivedise / $.View.md
Created February 7, 2012 01:29 — forked from jupiterjs/$.View.md
$.View for Alex MacCaw's Book

$.View - Client Side Templates

JavaScriptMVC's views are really just client side templates. Client side templates take data and return a string. Typically, the strings are HTML intended to be inserted into the DOM.

$.View is a templating interface that takes care of complexities using templates:

  • Convenient and uniform syntax
  • Template loading from html elements or external files
  • Synchronous or asynchronous template loading
  • Template preloading
layout title date comments categories
post
Installing Octopress
2011-08-18 19:56
true
linux octopress ruby rvm jekyll rubygems

I (rather obviously) recently found myself attempting to install Octopress. Sure, it has great documentation, but some areas were lacking -- specifically, initial setup. As someone who has not worked with Ruby before other than a rather limited Windows install for a jekyll project, I had virtually no experience installing Ruby, using RVM, or even playing with RubyGems.

@alivedise
alivedise / gist:1850168
Created February 17, 2012 03:00
[Grooveshark] BaseController
jQuery.Controller.extend("GS.Controllers.BaseController", {
setup: function() {
this._super.apply(this, arguments);
this.preSetup && this.preSetup()
},
init: function() {
this._super();
if ( this.onWindow && !this.isGSSingleton ) new this($(window));
else this.onElement && !this.isGSSingleton && new this($(this.onElement))
},