Skip to content

Instantly share code, notes, and snippets.

View zachzhao1984's full-sized avatar
🏠
Working from home

zach zhao zachzhao1984

🏠
Working from home
View GitHub Profile
@gaearon
gaearon / ReduxMicroBoilerplate.js
Last active March 26, 2020 00:35
Super minimal React + Redux app
import React, { Component } from 'react';
import { createStore, combineReducers, applyMiddleware, bindActionCreators } from 'redux';
import { provide, connect } from 'react-redux';
import thunk from 'redux-thunk';
const AVAILABLE_SUBREDDITS = ['apple', 'pics'];
// ------------
// reducers
// ------------
@staltz
staltz / introrx.md
Last active June 7, 2024 23:39
The introduction to Reactive Programming you've been missing
@cloudsben
cloudsben / md-menu.html
Last active June 14, 2023 07:46
markdown menu
<link rel="stylesheet" href="http://yandex.st/highlightjs/6.2/styles/googlecode.min.css">
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="http://yandex.st/highlightjs/6.2/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script type="text/javascript">
$(document).ready(function(){
$("h2,h3,h4,h5,h6").each(function(i,item){
var tag = $(item).get(0).localName;
@martinnormark
martinnormark / AlertView.js
Created February 7, 2013 10:25
Twitter Bootstrap Alert view for Backbone.js
(function () {
MyApp.AlertView = Backbone.View.extend({
tagName: "div",
className: "alert fade",
template: ["<a href=\"#\" data-dismiss=\"alert\" class=\"close\">&times;</a>", "<strong>{{ title }}</strong>", "{{ message }}"].join("\n"),
@rubiii
rubiii / how_it_works.md
Created December 2, 2012 11:14
MacVim-Formatter for RSpec
$ rspec --format MacVimFormatter --color spec
@huacnlee
huacnlee / gist:3936299
Created October 23, 2012 02:19
Mac 清理 TextMate 2 不断升级带出一堆多余的打开方式
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
@Shougo
Shougo / gist:3628411
Created September 5, 2012 00:14
.vimrc
"---------------------------------------------------------------------------
" Shougo's .vimrc
"---------------------------------------------------------------------------
" Initialize:"{{{
"
" Enable no Vi compatible commands.
set nocompatible
let s:is_windows = has('win32') || has('win64')
@thomaspark
thomaspark / bootswatchlet.js
Created August 16, 2012 04:32
Bootswatch bookmarklet
if($('.bootswatcher')[0]){
$('.bootswatcher').remove();
} else {
var $e = $('<select class="bootswatcher"><option>Amelia</option><option>Cerulean</option><option>Cosmo</option><option>Cyborg</option><option>Journal</option><option>Readable</option><option>Simplex</option><option>Slate</option><option>Spacelab</option><option>Spruce</option><option>Superhero</option><option>United</option></select>');
var l = 1 + Math.floor(Math.random() * $e.children().length);
var r = '<link rel="stylesheet" href="http://bootswatch.com/default/bootstrap-responsive.min.css">';
$e.css({'z-index': '99999', 'position': 'fixed', 'top': '5px', 'right': '5px', 'opacity': '0.5'}
).hover(
function(){$(this).css('opacity', '1');},
function(){$(this).css('opacity', '0.5');}
@yangchenyun
yangchenyun / gist:3215393
Created July 31, 2012 09:23
vim settings to delete trailing spaces when saving files
" removing trailing spaces before saving
autocmd FileType c,cpp,java,php,coffee,javascript,ruby,python,yaml,sh autocmd BufWritePre <buffer> :%s/\s\+$//e
@lotem
lotem / default.custom.yaml
Created July 9, 2012 12:23
自動識別西文及數字組成的用戶名
# default.custom.yaml
# 全局範圍識別輸入串爲 rime + 任意數字序列,以及形如 rimeime-1.2.3 的常用西文短語
# 也可將本組 patch 寫入 <輸入方案ID>.custom.yaml 使這組規則僅在一款輸入方案中有效
#
# 第一例,輸入 rime 之後,再輸入任意一個數字,則立即識別爲西文輸入
# 再加上 default.yaml 原有的 email 規則,識別包含 @ 字符的郵箱,於是可以一氣呵成 rime123@company.com
# 第二例,輸入到 rimeime 時,立即識別爲西文輸入,並可跟隨任意位數字及指定的符號
patch:
recognizer/patterns/rime123: "^rime[0-9]+$"