Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").
Author: Chris Jacob @_chrisjacob
Tutorial (Gist): https://gist.github.com/833223
| # stick it in your ~/.pryrc | |
| # use 'xsel' or 'xclip' if you're in a Linux environment | |
| # | |
| def _cp(obj = Readline::HISTORY.entries[-2], *options) | |
| if obj.respond_to?(:join) && !options.include?(:a) | |
| if options.include?(:s) | |
| obj = obj.map { |element| ":#{element.to_s}" } | |
| end | |
| out = obj.join(", ") | |
| elsif obj.respond_to?(:inspect) |
Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").
Author: Chris Jacob @_chrisjacob
Tutorial (Gist): https://gist.github.com/833223
| /* | |
| * Find the longest palindrome in the text. | |
| * | |
| * This is Greplin's first challenge, and I originally solved it in Python. | |
| * | |
| * The algorithm is not optimal, but simple on the eyes and easy to understand | |
| * On big inputs it's possible to use an approximately linear algorithm. | |
| * | |
| * Christian Stigen Larsen | |
| */ |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
| .monospace { | |
| font: 11px/1.3 Monaco !important; | |
| } | |
| /* slightly larger indentation of source code */ | |
| .outline-disclosure ol { | |
| -webkit-padding-start: 18px !important; | |
| } | |
| /* margin underneath styles panel heading */ |
| import gevent.monkey | |
| gevent.monkey.patch_all() | |
| import os | |
| import sys | |
| import fcntl | |
| import gevent | |
| from gevent.socket import wait_read | |
| from redis import Redis |
| /* | |
| * 频率控制 返回函数连续调用时,action 执行频率限定为 次 / delay | |
| * @param delay {number} 延迟时间,单位毫秒 | |
| * @param action {function} 请求关联函数,实际应用需要调用的函数 | |
| * @param tail? {bool} 是否在尾部用定时器补齐调用 | |
| * @return {function} 返回客户调用函数 | |
| */ | |
| var throttle = function(delay,action,tail,debounce) { | |
| var now = Date.now, last_call = 0, last_exec = 0, timer = null, curr, diff, | |
| ctx, args, exec = function() { |
#Four Ways To Do Pub/Sub With jQuery and jQuery UI (in the future)
Between jQuery 1.7 and some of work going into future versions of jQuery UI, there are a ton of hot new ways for you to get your publish/subscribe on. Here are just four of them, three of which are new.
(PS: If you're unfamiliar with pub/sub, read the guide to it that Julian Aubourg and I wrote here http://msdn.microsoft.com/en-us/scriptjunkie/hh201955.aspx)
##Option 1: Using jQuery 1.7's $.Callbacks() feature: