Skip to content

Instantly share code, notes, and snippets.

View dotSlashLu's full-sized avatar

Zhang Qiang dotSlashLu

View GitHub Profile
@dotSlashLu
dotSlashLu / fun_hoisting.coffee
Created June 26, 2014 02:38
Coffeescript has a problem with function definition
obj =
test: ->
subfunc()
subfunc = ->
null
@dotSlashLu
dotSlashLu / twitter_search.js
Last active January 3, 2016 13:49
Format Twitter feed pages(home, search result) into API format JSON
/**
* Copyright Dotslash.Lu <dotslash.lu@gmail.com>
*
* This script runs on Twitter feed pages(home, search results)
* and automatically get data including both the feed and the user
* then output them in the format of standard API request result
* thus bypassing the limit of the Twitter API
*/
function O(){}
@dotSlashLu
dotSlashLu / tabable.js
Created May 26, 2013 13:48
Make textareas able to insert tabs
function tab(event, obj) {
var tabKeyCode = 9;
if (event.which) // mozilla
var keycode = event.which;
else // ie
var keycode = event.keyCode;
if (keycode == tabKeyCode) {
if (event.type == "keydown") {
if (obj.setSelectionRange) {
// mozilla