Skip to content

Instantly share code, notes, and snippets.

Avatar
〽️

Yu-Cheng Chuang yorkxin

〽️
View GitHub Profile
@yorkxin
yorkxin / A Note to My Fifty-Year-Old Self.md
Last active Dec 2, 2020
流氓阿德 Ardor Huang【給五十歲自己的備忘錄 A Note to My Fifty-Year-Old Self】
View A Note to My Fifty-Year-Old Self.md
View Podcasts.opml
<?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 / hdmi.md
Last active Jun 9, 2020
Raspberry Pi with HDMI Switch
View hdmi.md

For some HDMI switches (e.g. ATEN), to make HDMI hot plugging work well with Raspberry Pi, set the following in /boot/config.txt:

hdmi_force_hotplug=1 # always output HDMI even if not plugged in
hdmi_drive=2         # always output audio to HDMI
hdmi_group=1         # use CET mode (compatible with TV)
hdmi_mode=16         # use 1080p; otherwise it may switch to SD resolution

References:

@yorkxin
yorkxin / README.md
Last active Mar 1, 2016
CJSX (CoffeeScript + JSX) to ES6
View README.md

(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 / Radio.md
Created Feb 14, 2016
廣播電台
View Radio.md
@yorkxin
yorkxin / Pie.jsx
Last active Sep 3, 2015
Pie progress component for React
View Pie.jsx
var Pie = React.createClass({
defaultProps: {
percentage: 0
},
calculateAngle: function(percentage) {
return (percentage) * (360 / 100);
},
render: function() {
var angle = this.calculateAngle(this.props.percentage);
View colors.txt
http://paletton.com/
(present = Full Colors)
Lightest Lighter Base Darker Darkest Hue ~=
#FF6363 #FF3939 #FF0000 #C50000 #9B0000 R 0
#FFA863 #FF9139 #FF7100 #C55700 #9B4500 RO 30
#FFCB63 #FFBD39 #FFAA00 #C58300 #9B6700 O 60
#FFE463 #FFDD39 #FFD300 #C5A300 #9B8000 OY 90
@yorkxin
yorkxin / README.md
Last active Aug 21, 2019
Proxy to remote server with CORS support
View README.md

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 / css_resources.md
Last active Aug 29, 2015 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.
View css_resources.md

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@yorkxin
yorkxin / rails_resources.md
Last active Aug 18, 2017 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.
View rails_resources.md

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