Skip to content

Instantly share code, notes, and snippets.

View novalagung's full-sized avatar
🏠

Noval Agung Prayogo novalagung

🏠
View GitHub Profile
@novalagung
novalagung / ca.md
Created July 19, 2018 08:26 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@novalagung
novalagung / app.js
Created January 23, 2018 07:14 — forked from acdlite/app.js
Quick and dirty code splitting with React Router v4
// getComponent is a function that returns a promise for a component
// It will not be called until the first mount
function asyncComponent(getComponent) {
return class AsyncComponent extends React.Component {
static Component = null;
state = { Component: AsyncComponent.Component };
componentWillMount() {
if (!this.state.Component) {
getComponent().then(Component => {
var portfolioMaster = db.getCollection('RAW_CORE_PROJECT').aggregate([
{ $group: {
_id: {
ProgramID: "$PROGRAM_ID",
Portfolio: "$PORTFOLIO_NAME",
}
} },
{ $project: {
ProgramID: "$_id.ProgramID",
Portfolio: "$_id.Portfolio",
package main
import "fmt"
func main() {
total := calculate(100)
fmt.Println("total", total) // should be 171700
}
func calculate(x int) int {
func Encrypt(text string) (string, error) {
plaintext := []byte(text)
key := []byte("*eaciit-standard-chartered-apps*")
c, err := aes.NewCipher(key)
if err != nil {
return "", err
}
@novalagung
novalagung / draw.swift
Created October 22, 2017 12:15
UserDefaults wrapper to easily store object or array of object in Swift
import Foundation
class Draw: NSObject, NSCoding {
var id: String = ""
var name: String = ""
var at: Date = Date()
override init() {
filter.html
<input id="country" />
<input id="region" />
function initFilter(parentSelector, modelHolder) {
$(parentSelector + '#country').kendoDropDownList({
value: modelHolder.country
})
$(parentSelector + '#region').kendoDropDownList({
[{
"_id" : "17004427|17004427|A07090<-xx>",
"ProgramId" : "17004427",
"ProgramName" : "ATM Replacement",
"ProjectId" : "17004427",
"ProjectName" : "ATM Replacement",
"TaskId" : "A07090<-xx>",
"TaskName" : "System Integration Test (SIT) signed-off",
"GoLiveDate" : ISODate("2017-07-06T00:00:00.000Z"),
"TaskActualDate" : ISODate("2017-07-06T00:00:00.000Z"),
@novalagung
novalagung / linux-command-cheatsheet.md
Last active November 1, 2023 16:45
Linux command cheatsheet, for beginner

Linux command cheatsheet, for beginner

Get executable location of running process by PID

# sudo readlink -f /proc/{PID}/exe
$ sudo readlink -f /proc/479/exe

/tmp/go-build499480868/command-line-arguments/_obj/exe/main