Skip to content

Instantly share code, notes, and snippets.

View xdite's full-sized avatar

Yi-Ting Cheng xdite

View GitHub Profile
@hSATAC
hSATAC / gist:5591270
Last active December 17, 2015 09:59
Shell function to send pull request using hub
# Usage: pr (pull request current branch into develop)
# Usage 2: pr stable (pull request current branch into stable)
# Notice: replace "team" with your github team account.
function pr() {
base=$1;
if [ "$1" == "" ]; then
base="develop"
fi
hub pull-request -b team:"$base" -h team:`git rev-parse --abbrev-ref HEAD`;
@penk
penk / TPB.AFK.2013.480p.h264-SimonKlose.CHT.srt
Last active June 5, 2017 03:49
《TPB AFK 海盜灣 - 暫時離開》 中文字幕
1
00:01:47,959 --> 00:01:51,400
三名瑞典人於今日遭到逮捕
罪名是涉嫌架設-
2
00:01:51,560 --> 00:01:57,400
-全世界最大的非法下載站台
3
@yorkxin
yorkxin / avoid-jquery-when-possible.md
Created July 7, 2012 13:04
Avoid jQuery When Possible

Avoid jQuery When Possible

jQuery does good jobs when you're dealing with browser compatibility. But we're living in an age that fewer and fewer people use old-school browsers such as IE <= 7. With the growing of DOM APIs in modern browsers (including IE 8), most functions that jQuery provides are built-in natively.

When targeting only modern browsers, it is better to avoid using jQuery's backward-compatible features. Instead, use the native DOM API, which will make your web page run much faster than you might think (native C / C++ implementaion v.s. JavaScript).

If you're making a web page for iOS (e.g. UIWebView), you should use native DOM APIs because mobile Safari is not that old-school web browser; it supports lots of native DOM APIs.

If you're making a Chrome Extension, you should always use native APIs, not only because Chrome has almost the latest DOM APIs available, but this can also avoid performance issue and unnecessary memory occupation (each jQuery-driven extension needs a separate

@xdite
xdite / 42-things.md
Created July 14, 2012 05:11
Ten (42) Things You Didn't Know Rails Could Do
@jakeonrails
jakeonrails / Ruby Notepad Bookmarklet
Created January 29, 2013 18:08
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
@dharrawal
dharrawal / dspy_logger.py
Last active March 10, 2024 14:41
A simple framework for logging calls to DSPy programs in a minimally obtrusive way
"""
DSPy Logging Utilities
Author: Dhar Rawal
"""
import functools
import json
from typing import Callable, Any, Dict, Tuple
from pydantic import BaseModel
import dspy