Skip to content

Instantly share code, notes, and snippets.

View yorkxin's full-sized avatar
〽️

Yu-Cheng Chuang yorkxin

〽️
View GitHub Profile
@yorkxin
yorkxin / README.md
Last active August 21, 2019 17:40
Proxy to remote server with CORS support

cors.py for mitmproxy

Hacking CORS restriction to enable in-browser XHR to any server.

Usage

Say you are running an web app at localhost, and you want to send XHR to http://remote-server:80, but the CORS restriction forbids access because you are sending requests from an origin that remote-server:80 does not allow.

Run:

@yorkxin
yorkxin / gist:221439
Created October 29, 2009 13:20
my DefaultFontFallbacks.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!-- ATSUI-compatible preferred fallback -->
<dict>
<!-- default ordered fallback list - fallback entity has to be PostScript name -->
<key>default</key>
<array>
<string>LucidaGrande</string> <!-- MAKE sure this matches the kCTFontSystemFontType in CTFontDescriptorCreateForUIType() & TDescriptorSourceImp::CreateDefaultDescriptor()! -->
<string>AppleSymbolsFB</string>
@yorkxin
yorkxin / KeyBindings.json
Last active November 29, 2018 20:40
My Sublime Text 2 Config
/* Default (OS X).sublime-keymap */
/* Key Bindings - User */
[
{ "keys": ["ctrl+shift+."], "command": "erb", "context":
[
{
"key": "selector",
"operator": "equal",
"operand": "text.html.ruby, text.haml, source.yaml, source.css, source.scss, source.js, source.coffee"
}
@yorkxin
yorkxin / .zshrc
Last active June 4, 2018 09:06
My ZSH Settings
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
#ZSH_THEME="yaci"
ZSH_THEME="yaci-agnoster"
@yorkxin
yorkxin / javascript_resources.md
Last active August 18, 2017 07:30 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@yorkxin
yorkxin / rails_resources.md
Last active August 18, 2017 06:44 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h
@yorkxin
yorkxin / Radio.md
Created February 14, 2016 17:50
廣播電台
@yorkxin
yorkxin / Podcasts.opml
Last active March 3, 2017 08:56
My Podcasts
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>iTunes Subscribed Feeds</title>
<dateCreated>Fri, 03 Mar 2017 08:41:34 GMT</dateCreated>
<dateModified>Fri, 03 Mar 2017 08:41:34 GMT</dateModified>
</head>
<body>
<outline text="硬影像" type="rss" xmlUrl="http://ipn.li/hardimage/feed" htmlUrl="https://ipn.li/hardimage/" />
<outline text="一天世界" type="rss" xmlUrl="http://ipn.li/yitianshijie/feed" htmlUrl="https://ipn.li/yitianshijie/" />
@yorkxin
yorkxin / README.md
Last active March 1, 2016 09:33
CJSX (CoffeeScript + JSX) to ES6

(Not) CJSX to ES6 converter

It does noly convert a small set of codes into ES6. You sill need to edit the file.

Usage

find ./components -name "*.cjsx" -exec ./converter.sh {} ;

@yorkxin
yorkxin / .vimrc
Last active December 22, 2015 03:18
my .vimrc
set cindent
set hls " highlight search rersult
set nocompatible
set sw=2
set ts=8
set cursorline
syntax on
if has('gui_running')