Skip to content

Instantly share code, notes, and snippets.

View patw0929's full-sized avatar

Patrick Wang patw0929

View GitHub Profile
@patw0929
patw0929 / README.md
Last active February 10, 2025 06:28
匯出 Authy 2FA 的方式

需求

有鑑於 Authy 近日停止了它們的 desktop 支援,導致使用上的不便利,所以想遷移到其他 2FA authenticator 中,不過 Authy 本身也未提供匯出功能,因此我們要想辦法解決。

在網上搜尋發現不少人有這個需求,也有人提供相關的 solution,例如這篇:https://gist.github.com/gboudreau/94bb0c11a6209c82418d01a59d958c93

我自己最後是借了一台 iPhone 15 來操作這個步驟,成功轉換,順便把步驟翻譯為中文版。

credits 皆屬原 gist thread 中的原作者們所有。

@patw0929
patw0929 / bitrise-android.yml
Last active January 29, 2020 00:13
Bitrise Setting Example
---
format_version: '5'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: react-native
workflows:
production:
after_run:
- _base
- _test_node
- _build
@patw0929
patw0929 / index.html
Last active August 4, 2018 09:05
react-intl-tel-input demo code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
@patw0929
patw0929 / cloudSettings
Last active February 17, 2020 15:57
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-02-13T02:09:35.051Z","extensionVersion":"v3.4.3"}
@patw0929
patw0929 / index.html
Last active July 26, 2016 03:24
Pure CSS text input with required tip
<div class="wrapper">
<input type="text" required>
<span class="tip">Required!</span>
</div>
@patw0929
patw0929 / arrangeMasonrySameHeight.js
Last active July 26, 2016 03:08
Make masonry layout has almost same height in every columns
var imageHeights = [5, 10, 100, 2, 200, 30, 90, 20, 44, 60, 12, 2, 10, 4, 5, 92, 10];
var baseArr = imageHeights.slice(0, 5);
var remainArr = imageHeights.slice(5);
var getMinIndex = function(arr) {
var min = arr[0];
var index = 0;
for (var i = 0; i < 5; i++) {
if (arr[i] < min) {
@patw0929
patw0929 / gallery.css
Last active July 25, 2016 15:55
Pure CSS Responsive Gallery (divs with 1:1 aspect ratio) http://jsbin.com/senujig/edit?html,css,output
@patw0929
patw0929 / array.js
Last active July 27, 2016 07:12
Array practice
// - slice
const p1Arr = [1, 2, 3, 4, 5, 6];
console.log(p1Arr.slice(0, 3)); // [1, 2, 3]
// - splice
const p2Arr = [1, 2, 3, 4, 5, 6];
p2Arr.splice(1, 3, 9, 9, 9);
console.log(p2Arr); // [1, 9, 9, 9, 5, 6]
// - pop
@patw0929
patw0929 / .babelrc
Last active March 3, 2016 10:28
react-intl-tel-input test
{
presets: ["es2015", "react", "stage-0"],
plugins: ["transform-class-properties"],
}
@patw0929
patw0929 / gist:39af8527700c55b13761
Created April 21, 2015 11:13
[jQuery] Center text in the dropdown list (<select>)
var _optimize_selectbox_padding = function () {
$(".search__county, .search__district").each(function () {
var text_width = (parseInt($(this).css("font-size"), 10) * $(this).val().length);
var padding = (($(this).outerWidth() - text_width) / 2);
$(this).css("padding-left", padding);
});
};
_optimize_selectbox_padding();
$(".search__county, .search__district").on("change", function () {