Skip to content

Instantly share code, notes, and snippets.

import{a as ht}from"./chunks/mermaid.esm.min/chunk-VJ75ZXLX.mjs";import{a as Yt}from"./chunks/mermaid.esm.min/chunk-JAUDZS37.mjs";import{a as Ut,b as qt}from"./chunks/mermaid.esm.min/chunk-7UE6YSXL.mjs";import{a as Bt}from"./chunks/mermaid.esm.min/chunk-S4NM7E3C.mjs";import"./chunks/mermaid.esm.min/chunk-I5NS4IKS.mjs";import"./chunks/mermaid.esm.min/chunk-UJJ4OR2L.mjs";import"./chunks/mermaid.esm.min/chunk-I4MCLGIM.mjs";import"./chunks/mermaid.esm.min/chunk-6UVSVS4N.mjs";import"./chunks/mermaid.esm.min/chunk-QYD3RZ7T.mjs";import{b as Ot,d as Pt}from"./chunks/mermaid.esm.min/chunk-6UYDIWFQ.mjs";import{b as Vt,j as yt,l as $t,m as V,n as Nt,o as Ht}from"./chunks/mermaid.esm.min/chunk-H7M3GQKH.mjs";import"./chunks/mermaid.esm.min/chunk-XBXGYYE5.mjs";import{$ as z,E as Ft,G as It,H as X,I as rt,J as W,K as _t,L as Gt,N as zt,a as St,aa as K,h as tt,k as ut,l as Mt,m as At,n as Tt,o as Dt,p as Ct,q as G,r as Rt,s as Y,u as kt,y as jt}from"./chunks/mermaid.esm.min/chunk-SQX4BMY3.mjs";import{b as g,c as lt,h as k}fr
As a Java developer,
Please learn:
1. Core Java Mastery
- OOP principles (SOLID, DRY, KISS)
- Generics, Lambda expressions, Functional interfaces
- Java Streams API (map/reduce, collectors)
- Java Collections framework
- Java Reflection API
@jeffhuangtw
jeffhuangtw / AndroidManifest.xml
Created February 11, 2022 01:22
android 12 ble
<manifest>
<!-- Request legacy Bluetooth permissions on older devices. -->
<uses-permission android:name="android.permission.BLUETOOTH"
android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"
android:maxSdkVersion="30" />
<!-- Needed only if your app looks for Bluetooth devices.
You must add an attribute to this permission, or declare the
ACCESS_FINE_LOCATION permission, depending on the results when you
@jeffhuangtw
jeffhuangtw / Instructions.sh
Created August 30, 2018 01:19 — forked from GhazanfarMir/Instructions.sh
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@jeffhuangtw
jeffhuangtw / JSON2CSV.js
Created January 3, 2018 08:17
Convert json object to csv download link javascript
// Sample: download json as excel file (BOM + utf-16le encoding)
// reference:
// https://gist.github.com/maciejjankowski/2db91642fb9eaa771111f2c0538e4560
//
<script>
function JSON2CSV(objArray) {
var array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray;
var str = '';
var line = '';
// header
const admin = require("admin");
function getFirebaseUser(req, res, next) {
console.log("Check if request is authorized with Firebase ID token");
if (
!req.headers.authorization ||
!req.headers.authorization.startsWith("Bearer ")
) {
console.error(
"No Firebase ID token was passed as a Bearer token in the Authorization header.",
@jeffhuangtw
jeffhuangtw / gist:e64fa7eabf6e16e01842e76ff53ba233
Created September 18, 2017 09:30
[Visual Studio Code] [nodejs] [debugger] [foreman] vsc + foreman + debugger
// 1. add a executable dev.sh to run your script (example: web.js)
#!/bin/bash
node --inspect web.js
// 2. install foreman
$ npm install -g foreman
// 3. prepare your environment variables file
$ touch .env
@jeffhuangtw
jeffhuangtw / sample.js
Created March 15, 2017 09:52
[nodejs] server side check "androidpublisher.purchases.subscriptions.get" with "service account"
// Google Play API Key
// ref: http://stackoverflow.com/questions/35127086/android-inapp-purchase-receipt-validation-google-play
// ref: https://developers.google.com/android-publisher/authorization
// ref: http://google.github.io/google-api-nodejs-client/18.0.0/index.html#toc14__anchor
//
// install npm package
// ref: https://github.com/google/google-api-nodejs-client
// $ npm install googleapis --save
//
const google = require('googleapis');
@jeffhuangtw
jeffhuangtw / gist:541e7b5ad6701671ce06
Created January 6, 2016 12:26
machine learning note
Coursera course
https://www.coursera.org/learn/machine-learning
Week 1 Note:
Partial derivative in gradient descent for two variables
https://math.stackexchange.com/questions/70728/partial-derivative-in-gradient-descent-for-two-variables/189792#189792
Gradient descent
https://www.youtube.com/watch?v=WnqQrPNYz5Q&ab_channel=AlexanderIhler
@jeffhuangtw
jeffhuangtw / sample.js
Created October 2, 2015 17:03
Resend Parse User Verification Email Cloud Code
// resend verify email
Parse.Cloud.define("ResendVerifyEmail", function(request, response) {
var user = Parse.User.current();
if (!user) {
response.error("INVALID_USER");
return;
}
var email = request.params.email;
var query = new Parse.Query(Parse.User);
Parse.Cloud.useMasterKey();