Skip to content

Instantly share code, notes, and snippets.

react-native-swiper: https://github.com/leecade/react-native-swiper
react native custom calendar: https://github.com/wix/react-native-calendars
Victory: Charting for React and React Native: https://formidable.com/open-source/victory/gallery
react-native-shared-element: https://github.com/IjzerenHein/react-native-shared-element
React Native Shared Element Transition React Navigation V5: https://www.youtube.com/watch?v=C2Q_MPxqLMI&t=0s
Assume the design/software made be wrong until tested/evaluated, it's how it goes forward: https://www.youtube.com/watch?v=eozFlgu6ByY
@xuan9
xuan9 / package.json
Created June 21, 2018 12:56
react native project package.json
{
"name": "myapp",
"version": "1.0.0",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"backend": "sudo php -S 0.0.0.0:8000 -t ../myapp-web/src/public/",
"iphone": "react-native run-ios --configuration Release --device",
"clean-bundle:ios": "rm -f ./ios/main.jsbundle*",
@xuan9
xuan9 / getiOSDistName.sh
Last active May 6, 2021 06:50
react native packaging scripts
export shortVersion=$( /usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" ios/myapp/Info.plist );
export bundleVersion=$( /usr/libexec/PlistBuddy -c "Print CFBundleVersion" ios/myapp/Info.plist );
export distName=MyApp-$shortVersion-$bundleVersion
@xuan9
xuan9 / layoutVideos.js
Last active September 1, 2016 13:01
auto layout html5 videos for webrtc call or meeting
var layoutVideosTimer, hideVideoMenuTimer;
function showVideoMenuForAWhile() {
console.debug("showVideoMenuForAWhile");
clearTimeout(hideVideoMenuTimer);
showVideosMenu();
hideVideoMenuTimer = setTimeout(hideVideosMenu, 30000);
}
#!/bin/bash
# If Tomcat uses server.xml config to rotate localhost_access_log,
# the daily rotated logs will need compressing and old ones deleted to stop filling
# the log partiton. Cannot use the system logrotate command as conficts with tomcat rotate
# therefore run this script in a daily cronjob
#
# localhost_access_log.2015-09-03.txt
#
# Add this script in /etc/cron.daily/ owned by root
#
@xuan9
xuan9 / gist:3c4ea894742f1e2ced05
Created May 5, 2015 15:12
import new CA cert to Java CA on Mac
sudo /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/keytool -importcert -file ~/Downloads/a.cert -keystore /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/security/cacerts
sudo /Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home/bin/keytool -importcert -file ~/Downloads/a.cert -keystore /Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home/lib/security/cacerts
sudo /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/keytool -importcert -file ~/Downloads/a.cert -keystore /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/security/cacerts
@xuan9
xuan9 / gist:441ec38a5db683e8fa9f
Created April 27, 2015 08:35
distinct colors. not good though
var divs=[0,1/2,1/4,3/4,1/8,5/8,3/8,7/8];
function getDiv(index){
for(var i=divs.length;i<index;i++){
var root = Math.ceil(Math.log2(i+1));
var div=Math.pow(2, root);
var lastDiv=Math.pow(2, root-1);
var value=divs[i-lastDiv] + 1/div;
divs[i]=value;
}
logs
# Eclipse Setting
/.metadata
/Servers
.settings
.project
.classpath
.buildpath
RemoteSystemsTempFiles