Skip to content

Instantly share code, notes, and snippets.

View stevemu's full-sized avatar

Steve Mu stevemu

View GitHub Profile
@stevemu
stevemu / java-object-encryption-with-file.java
Last active March 21, 2025 00:07
How to encrypt an object and write it to file in Java and decrypt it
import javax.crypto.*;
import javax.crypto.spec.IvParameterSpec;
import java.io.*;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
public class Main {
@stevemu
stevemu / using-react-native-maps.js
Last active December 25, 2017 01:00
This file showcase how to do following features with react-native-maps: 1. show direction between two points (it use user's current coordinates and a custom set destination coordinates) 2. Show a marker 3. When click on the marker, show a call out 4. when click on the callout, launch Google Map for turn-by-turn navigation
import React, { Component } from 'react';
import {
StyleSheet,
Button,
Text,
View,
TextInput,
ImageBackground,
ActivityIndicator,
Linking,
import React, { Component } from 'react';
import { StyleSheet,
Button,
Text,
View,
TextInput,
ImageBackground,
ActivityIndicator,
Linking,
TouchableOpacity } from 'react-native';