Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jarvisluong's full-sized avatar
:octocat:
Never AWOL

D.H. Luong jarvisluong

:octocat:
Never AWOL
View GitHub Profile
@jarvisluong
jarvisluong / .gitlab-ci.yml
Created August 12, 2020 09:19
Gitlab ci job with gmsaas detox
e2e_run:
stage: e2e
services:
- node:lts-alpine
image: testimio/gmsaas
before_script:
- npm install -g detox-cli
script:
- gmsaas auth login $GENYMOTION_USERNAME $GENYMOTION_PASSWD
# The recipe id 80a67ae9-430c-4824-a386-befbb19518b9 is Google Nexus 6
@jarvisluong
jarvisluong / index.js.patch
Created April 8, 2020 09:27
Patch serverless-tencent-tools
--- index.js 2020-04-08 12:26:27.000000000 +0300
+++ index.new.js 2020-04-08 12:26:08.000000000 +0300
@@ -79,7 +79,7 @@
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }}
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
}
if (op[0] & 5) throw op[1]
@jarvisluong
jarvisluong / MainApplication.java
Created April 30, 2019 12:42 — forked from tsapeta/MainApplication.java
Configuring unimodules on Android
// Replace com.myapp with your app's package name
package com.myapp;
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
Verifying my Blockstack ID is secured with the address 1NdXY7NnA9ZVdg3D83ZhwHy1x4SxLCq5Rt https://explorer.blockstack.org/address/1NdXY7NnA9ZVdg3D83ZhwHy1x4SxLCq5Rt
@jarvisluong
jarvisluong / configureStore.js
Created September 22, 2018 18:50
Custom redux persist version for redux-offline
//@flow
import { createStore, applyMiddleware } from 'redux';
import storage from 'redux-persist/lib/storage'
import { composeWithDevTools } from 'redux-devtools-extension';
import { persistStore, persistReducer } from 'redux-persist';
import thunk from 'redux-thunk';
import reducer from 'reducers';
import { createOffline } from '@redux-offline/redux-offline';
import offlineConfig from '@redux-offline/redux-offline/lib/defaults/index';
// @flow
import Alert from 'utils/AlertUtils';
import { ImagePicker as ExpoImagePicker, Permissions } from 'expo';
export default {
async launchCameraAsync(options: {
allowsEditing?: boolean,
quality?: number
}): Promise<{ uri?: string }> {
const { status: cameraPermission } = await Permissions.askAsync(
import React from 'react';
import {TouchableWithoutFeedback, Text, View} from 'react-native';
import * as Animatable from 'react-native-animatable';
Animatable.initializeRegistryWithDefinitions({
bounceLeftRight: {
0: {
translateX: 0,
},
0.3: {
content = [1,2,3,4,5,6,7,8,9,10]
<SafeAreaView style={styles.container}>
<KeyboardAvoidingView style={styles.keyboardAvoidContainer} behavior="padding">
<ScrollView style={{flex: 1}}>
{content.map(num => (
<View style={{height: 80, margin: 10, borderWidth: 1, justifyContent: 'center', alignItems: 'center'}} key={num}>
<Text>{num}</Text>
</View>
)}
@jarvisluong
jarvisluong / Count lines in Git repo
Created November 5, 2017 09:04 — forked from mandiwise/Count lines in Git repo
A command to calculate lines of code in all tracked files in a Git repo
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
$ git ls-files | xargs wc -l
@jarvisluong
jarvisluong / upload_to_pcloud.sh
Created July 20, 2017 08:46
Upload file to Pcloud via Rest API
#!/bin/bash
while :
do
zip -r $ZIP_FILENAME $FOLDERNAME && curl -F 'filename=@$ZIP_FILENAME' 'https://api.pcloud.com/uploadtolink?code=$PCLOUD_UPLOAD_CODE' && rm -f $ZIP_FILENAME && sleep $SLEEPTIME
done
#ZIP_FILENAME: file name of the zip you want to name it
#FOLDERNAME: the folder you want to zip
#PCLOUD_UPLOAD_CODE: go to pcloud, generate an upload link, you will find the code
#SLEEPTIME: the sleep interval for each upload cycle, if you want this to be a loop