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 May 24, 2022 02:30
Config rbenv to use Homebrew-installed Ruby

A workaround for developers who cannot build Ruby from source code on their machine.

brew install ruby@<version>
ln -s $(brew --prefix ruby@<version>) ~/.rbenv/versions/<version>

For exmaple

@yorkxin
yorkxin / A Note to My Fifty-Year-Old Self.md
Last active December 2, 2020 10:55
流氓阿德 Ardor Huang【給五十歲自己的備忘錄 A Note to My Fifty-Year-Old Self】
@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 / hdmi.md
Last active June 9, 2020 19:44
Raspberry Pi with HDMI Switch

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 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 / Radio.md
Created February 14, 2016 17:50
廣播電台
@yorkxin
yorkxin / Pie.jsx
Last active September 3, 2015 06:00
Pie progress component for React
var Pie = React.createClass({
defaultProps: {
percentage: 0
},
calculateAngle: function(percentage) {
return (percentage) * (360 / 100);
},
render: function() {
var angle = this.calculateAngle(this.props.percentage);
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 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 / css_resources.md
Last active August 29, 2015 14:10 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

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