Skip to content

Instantly share code, notes, and snippets.

View novalagung's full-sized avatar
🏠

Noval Agung Prayogo novalagung

🏠
View GitHub Profile
db.RatioFormula.find({ _id: { $in: [
"GPMARGIN",
"EBITDAMARGIN",
"PBTMARGIN",
"PATMARGIN",
"ROCE",
"CASHPROFIT"
] } }).forEach(function (d) {
d.subsection = "PROFITABILITY RATIO"
db.RatioFormula.save(d)
svn update
$GOPATH/bin/gorep -path="." -from="eaciit/x10" -to="eaciit/x10-dev"
sudo pkill X10-dev
rm nohup.out
go build -o X10-dev
nohup ./X10-dev &
@novalagung
novalagung / facebook-photo-post-javascript.js
Created September 21, 2016 02:21 — forked from andyburke/facebook-photo-post-javascript.js
How to post a photo to Facebook from client-side Javascript
// This bit is important. It detects/adds XMLHttpRequest.sendAsBinary. Without this
// you cannot send image data as part of a multipart/form-data encoded request from
// Javascript. This implementation depends on Uint8Array, so if the browser doesn't
// support either XMLHttpRequest.sendAsBinary or Uint8Array, then you will need to
// find yet another way to implement this. (This is left as an exercise for the reader,
// but if you do it, please let me know and I'll integrate it.)
// from: http://stackoverflow.com/a/5303242/945521
if ( XMLHttpRequest.prototype.sendAsBinary === undefined ) {
@novalagung
novalagung / upload2facebook
Created September 21, 2016 02:08 — forked from nseo/upload2facebook
A sample code to upload an image file to facebook using Facebook javascript sdk
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>Hello FB</title>
</head>
<body>
<div id="fb-root"></div>
<div id="fb-content"></div>
<div>
if r.Method != "POST" {
http.Error(w, "Only accept POST request", http.StatusBadRequest)
return
}
basePath, _ := os.Getwd()
reader, err := r.MultipartReader()
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
'use strict'
import babelify from 'babelify'
import browserify from 'browserify'
import path from 'path'
import buffer from 'vinyl-buffer'
import source from 'vinyl-source-stream'
import watchify from 'watchify'
import gulp from 'gulp'
[{
Id: "01",
Name: "GROWTH",
Value: "121.50%",
Description: "{ (Sales/Receipts for current year) / (Sales / Receipts for previous year) } -1",
Expand: true,
Children: [{
Id: "a01",
Name: "(Sales/Receipts for current year) /",
Value: 40170,
otherRoutes := map[string]knot.FnContent{
"/": func(r *knot.WebContext) interface{} {
fmt.Println("-----", "asdfsdfa")
rURL := r.Request.URL.String()
{
"content": [{
"id": "1",
"matan": "فَاذْكُرُونِي أَذْكُرْكُمْ",
"translation": "Ingatlah kamu kepada-Ku niscaya Aku ingat (pula) kepadamu",
"reference": "QS. Al Baqarah: 152",
"type": "quran verse"
}, {
"id": "2",
"translation": "Waktu yang digunakan untuk menunggu atau antri, akan menjadi kehidupan (waktu) yang sia-sia jika tidak diisi dengan hal-hal yang bermanfaat",
// refresh chart aja
$('#suppliertypeChart').data('kendoChart').redraw();
// reload data + refresh chart
$('#suppliertypeChart').data('kendoChart').dataSource.read();
// refresh grid aja
$('#grid-processes').data('kendoGrid').refresh();
// reload data + refresh grid