Skip to content

Instantly share code, notes, and snippets.

View patw0929's full-sized avatar

Patrick Wang patw0929

View GitHub Profile
@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 () {
@patw0929
patw0929 / gist:6b9ebee446111d9bf098
Last active August 29, 2015 14:03
自動清除 Facebook 分享連結 cache 工具
#!/bin/bash
# 自動清除 Facebook 分享連結 cache 工具
# ----------------------------------------
# 使用方法:fb_cache_cleaner.sh domain.com folder 起始序號 結束序號
# 詢問帳號密碼 (Facebook Debug Tool 目前需要登入方可使用)
echo -n "Facebook Email: "
read EMAIL
echo -n "Facebook Password: "