Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Daniel Dai danieldai

🎯
Focusing
View GitHub Profile
@danieldai
danieldai / t.js
Created Feb 1, 2021
Get nested property of a JavaScript object
View t.js
function getNestedProperty(obj, path) {
let myObj = obj;
for (let name of path.split('.')) {
if(myObj) {
myObj = myObj[name];
} else {
break;
}
}
return myObj;
@danieldai
danieldai / gist:42c758f639155f7281821b66839bd1c0
Created Oct 19, 2018
The single command to import cert into java system truststore for all linux like systems
View gist:42c758f639155f7281821b66839bd1c0
sudo keytool -import -alias cacerts -keystore $(readlink -f /usr/bin/java | sed "s:bin/java::")lib/security/cacerts -file ca.crt