Skip to content

Instantly share code, notes, and snippets.

Avatar
😀
Happy

hxgdzyuyi

😀
Happy
View GitHub Profile
@hxgdzyuyi
hxgdzyuyi / Gemfile
Created May 11, 2012
导出人人网生日信息
View Gemfile
source 'http://rubygems.org'
gem 'omniauth-renren', '~> 1.0.0.rc2', :git => 'git://github.com/huangxiangdan/omniauth-renren.git'
gem 'renren'
gem 'sinatra'
gem 'shotgun'
gem 'icalendar'
@hxgdzyuyi
hxgdzyuyi / gist:2728798
Created May 19, 2012 — forked from xupeng/gist:2728385
自动跳转到广播页
View gist:2728798
// ==UserScript==
// @name Hide someone
// @description Hide someone
// @author Hxgdzyuyi
// @include http://www.douban.com/
// @version 1.4
// @run-at document-start
// ==/UserScript==
View .vimrc
runtime! debian.vim
syntax on
source ~/.vim/vimrc_vundle
set nocompatible
set noswapfile
set fileencodings=ucs-bom,utf-8,chinese,cp936
set isk+=-
set list
set listchars=tab:▸\ ,trail:·
@hxgdzyuyi
hxgdzyuyi / backbone-mixin.js
Created Sep 6, 2012 — forked from dmitry/backbone-mixin.js
Merge backbone views (mixin pattern)
View backbone-mixin.js
define('backbone', ['lib-underscore', 'lib-backbone'], function () {
Backbone.mixin = function (view, mixin, custom) {
if (custom) {
if (custom.events && mixin.events) {
mixin = _.clone(mixin)
_.defaults(custom.events, mixin.events)
}
_.extend(mixin, custom)
}
var source = view.prototype || view
View gist:3968177

我是

def my_cool_method(message)
  puts message
end
View rendered.js
var log = console.log;
var ViewBase = Backbone.View.extend({
initialize: function(){
var oldRender = this.render;
this.render = function(){
oldRender.call(this);
log('trigger event\'s rendered')
}
},
render: function(){
View ctags
--langdef=mako
--langmap=mako:.html
--regex-mako=/def[ \t]name=['"](.*)['"]/\1/f,function/
--regex-mako=/article/\0/f,function/
--regex-mako=/aside/\0/f,function/
View gist:4125224
mplayer -ss 00:00:26 -nosound -vo jpeg:outdir=./flv -frames 2 ./demo4.wmv
mencoder -forceidx -of lavf -oac mp3lame -lameopts abr:br=56 -srate 22050 -ovc lavc -lavcopts vcodec=flv:vbitrate=5000:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -vf scale=360:240 -o $1.flv $1
View gist:4217040
  1. 新建文章,添加到具体分类
  2. 文章选一个特色图像。特色图像左边有个一个放media的地方, 下拉默认为embed,改成modal。 url贴入视频地址
  3. 在需要的自定义页面插入porfolio代码 【不包括注释,像gallery那样】
  • 其中category的id 在分类管理的地方 你可以鼠标移动到分类上面然后看chrome左下角的url。 其中tag_id变量后面的数字就是category的id
[portfolio count="3" category="id"]
View gist:4291755
[divider]
<img src="http://www.renklibeyaz.com/rightnowwp/wp-content/uploads/2012/02/contact.jpg" alt="" title="contact" width="600" height="350" class="alignnone size-full wp-image-91" />
[1of2]
<h4>GET IN TOUCH</h4>
[divider height="13"]
Pellentesque eu ultrices diam. Duis odio justo, sodales ac pretium quis, scelerisque vulputate massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Mauris eleifend, enim in accumsan consectetur, lectus augue vulputate sapien, nec lacinia velit est feugiat felis. Integer tortor lacus, commodo et lacinia id, volutpat eget odio. Duis auctor, arcu id consequat suscipit, erat dui molestie ipsum, tempor tincidunt lacus tellus ac elit. Ut dapibus elementum magna, fermentum elementum tellus tempus nec. Fusce sit amet dui urna, ac scelerisque massa. Aenean placerat, erat eget commodo euismod, est turpis feugiat nisl, tristique sagittis nisl nulla sed. Arcu id consequat suscipit, erat dui molestie ipsum, tempor tincidunt lacus tellus ac e