Skip to content

Instantly share code, notes, and snippets.

View jebai0521's full-sized avatar
🎯
Focusing

Chen Ming jebai0521

🎯
Focusing
View GitHub Profile
@jebai0521
jebai0521 / distribute-appcenter-ios.sh
Created March 12, 2020 01:15
distribute-appcenter-ios.sh
#!/bin/sh
# sample
# Sample: appcenter distribute release -f /Users/mingchen/workspace/apps/a4.86/android/app/build/outputs/apk/release/app-release.apk --silent -g Collaborators -a Perkd/Perkd4.86 -b 1985
# Help: appcenter help distribute release
#
# Usage: appcenter distribute release -f|--file <arg> [--silent] [-R|--release-notes-file <arg>] [-r|--release-notes <arg>] [-s|--store <arg>] [-g|--group <arg>] [-n|--build-number <arg>]
# [-b|--build-version <arg>] [-a|--app <arg>]
@jebai0521
jebai0521 / distribute-appcenter-android.sh
Last active March 12, 2020 01:13
distribute-appcenter-android.sh
#!/bin/sh
# sample
# Sample: appcenter distribute release -f /Users/mingchen/workspace/apps/a4.86/android/app/build/outputs/apk/release/app-release.apk --silent -g Collaborators -a Perkd/Perkd4.86 -b 1985
# Help: appcenter help distribute release
#
# Usage: appcenter distribute release -f|--file <arg> [--silent] [-R|--release-notes-file <arg>] [-r|--release-notes <arg>] [-s|--store <arg>] [-g|--group <arg>] [-n|--build-number <arg>]
# [-b|--build-version <arg>] [-a|--app <arg>]
@jebai0521
jebai0521 / container-template.js
Last active March 12, 2020 01:18
container-template.js
import React from 'react';
import {View} from 'react-native';
export default class App extends React.Component {
render() {
return <View style={{flex: 1, backgroundColor: 'red'}} />;
}
}
@jebai0521
jebai0521 / ajv-email-validate.js
Last active March 12, 2020 01:18
ajv-email-validate.js
// Map
// Payment
// import Ajv from 'ajv';
const Ajv = require('ajv');
var ajv = new Ajv(); // options can be passed, e.g. {allErrors: true}
ajv.addFormat('email', '^(([^<>()\\[\\]\\\\.,;:\\s@"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@"]+)*)|(".+"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$');
# for Proxy
export ALL_PROXY=socks5://127.0.0.1:10000
#export ALL_PROXY=http://127.0.0.1:9999
#export http_proxy=http://127.0.0.1:9999
#export https_proxy=https://127.0.0.1:50085
export npm_config_proxy=http://127.0.0.1:9999
export npm_config_https_proxy=http://127.0.0.1:9999
# For .nvm
@jebai0521
jebai0521 / react-native-android-reverse-tool.js
Last active March 12, 2020 01:19
react-native-android-reverse-tool.js
#!/usr/bin/env node
const {exec} = require('child_process');
const execute = (cmd) => {
console.log('command ==> ', cmd);
return new Promise((resolve, reject) => {
exec(cmd, (error, stdout, stderr) => {
if (error) {
console.warn(error);
@jebai0521
jebai0521 / cases.js
Last active December 3, 2019 03:11
Compare JS Array Use Lodash
const _ = require('lodash');
// compare object , same key and value, different key sort
function case1 () {
const a = { k1: 'v1', k2: { k21: 'v21' } };
const b = { k2: { k21: 'v21' }, k1: 'v1' };
console.log(_.isEqual(a, b));
// output
@jebai0521
jebai0521 / cloudSettings
Last active August 3, 2022 17:37
track shopify theme via git
{"lastUpload":"2022-08-03T17:37:34.204Z","extensionVersion":"v3.4.3"}
<div id="IssueCardForm" class="form-vertical hide">
{% form 'customer_login' %}
{{ form.errors | default_errors }}
<label for="CustomerEmail" class="hidden-label">{{ 'customer.login.email' | t }}</label>
<input type="phone" name="customer[phone]" id="CustomerPhone" class="input-full{% if form.errors contains 'email' %} error{% endif %}" placeholder="{{ 'customer.login.phone' | t }}" autocorrect="off" autocapitalize="off" autofocus>
<!-- {% if form.password_needed %}
<label for="CustomerPassword" class="hidden-label">{{ 'customer.login.password' | t }}</label>
@jebai0521
jebai0521 / locales-test.js
Last active March 12, 2020 01:22
locales-test
const locale = require('locale')
supported = new locale.Locales(['en', 'en_US'], 'en');
console.log ((new locale.Locales('en')).best(supported).toString()); // 'en'
console.log ((new locale.Locales('en_GB')).best(supported).toString()); // 'en'
console.log ((new locale.Locales('en_US')).best(supported).toString()); // 'en_US'
console.log ((new locale.Locales('jp')).best(supported).toString()); // en