Skip to content

Instantly share code, notes, and snippets.

View jebai0521's full-sized avatar
🎯
Focusing

Chen Ming jebai0521

🎯
Focusing
View GitHub Profile
import { NativeModules } from 'react-native';
import CookieManager from '@react-native-community/cookies';
import SQLite from '@emanon_/react-native-sqlite-storage';
import { DEVICE } from 'common/constants';
import { File } from 'common/files';
const { PerkdHelper } = NativeModules,
DELTA_EPOCH_IN_MICROSECS = 11644473600000000;
func dingTalkMessage(_ message: String?) {
NotificationService .dingTalkMessage(message);
}
static func dingTalkMessage(_ message: String?) {
let date = Date()
let fmt = DateFormatter()
fmt.dateFormat = "yyyy-MM-dd HH:mm:ss.SSS"
- (NSArray *)objectProperties:(NSObject *)object {
// RCTLog(@"objectProperties %@ %@ Enter", object, object.class);
NSMutableArray* properties = [NSMutableArray new];
unsigned int count;
Class cls = [object class];
// RCTLog(@"objectProperties %@", cls);
do {
// RCTLog(@"objectProperties Current %@", cls);
objc_property_t* props = class_copyPropertyList(cls, &count);
for (int i = 0; i < count; i++) {
@jebai0521
jebai0521 / phoneformat.js
Created June 22, 2020 07:26
phoneformat
var phoneformat = require('phoneformat.js');
console.log(phoneformat.formatInternational('VN', '+842743729050', ))
status2: (place, options = {}) => {
if (!place.openingHours
|| (!place.openingHours.periods && !place.openingHours.specific)
|| (place.openingHours.periods && !place.openingHours.periods.length)) {
return { status: UNKNOWN, openingTime: null };
}
const now = options.now || newDate(),
@jebai0521
jebai0521 / days.js
Created June 14, 2020 03:00
week days
function days(ds) {
const results = [];
for (let i = 0; i < ds.length;) {
// if (i === 0)results.push(days[i]);
console.log(i);
const s = i;
let t = i;
while (ds[t + 1] && ds[t] && ds[t + 1] - ds[t] === 1) {
@jebai0521
jebai0521 / index.js
Created June 8, 2020 06:11
array combin
const a = {
key: 'openingHours',
type: 'openingHours',
placeholder: 'form_opening_hours',
properties: {
// name: 'openingHours',
},
};
function getUrlParams()
{
 var url = window.location.toString();
 var qs = url.split("?")[1];
if (!qs) return {};
var params = {};
qs.split('&').forEach(function(pair){
var kv = pair.split('=');
params[kv[0]] = kv[1];
})
@jebai0521
jebai0521 / sha256benchmark.js
Created April 14, 2020 03:41
sha256benchmark.
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/
import React from 'react';
import ReactAES from 'react-native-aes-encryption';
@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>]