Skip to content

Instantly share code, notes, and snippets.

View novalagung's full-sized avatar
🏠

Noval Agung Prayogo novalagung

🏠
View GitHub Profile
@novalagung
novalagung / AllGattCharacteristics.java
Created May 21, 2021 14:34 — forked from sam016/AllGattCharacteristics.java
Bluetooth GATT Services & Characteristics
package com.sam016.vsflatomation.service.ble;
import java.util.HashMap;
import java.util.UUID;
public class AllGattCharacteristics {
private static HashMap<String, String> attributes = new HashMap();
static {
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name");
@novalagung
novalagung / goth
Last active November 23, 2023 07:15 — forked from ammario/goth
golang test coverage html
#!/bin/bash
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out
@novalagung
novalagung / pr.md
Created February 19, 2020 02:33 — forked from karlhorky/pr.md
Fetch all GitHub pull requests to local tracking branches
@novalagung
novalagung / mongodb_ssl_with_letsencrypt.md
Created June 11, 2019 08:26 — forked from leommoore/mongodb_ssl_with_letsencrypt.md
MongoDB 3.2.x SSL with Letsencrypt

#MongoDB 3.2.x SSL with Letsencrypt Letsencrypt is an initative which aims to increase the use of encryption for websites. It basically allows people to apply for free certificates provided that they prove the they control the requested domain. We will look at the what is needed to secure your MongoDB installation. For more details on setting up a MongoDB server see MongoDB 3.2.x.

##Set the hostname We sould to set the hostname to match the name of the certificate we are going to optain.

sudo hostname mongo0.example.com

Then update the hostname file to set the server name permanently.

@novalagung
novalagung / gist:a0fddc1d0161599572ee9871146d2992
Created May 14, 2019 02:31 — forked from sanatgersappa/gist:4030649
Querying Sharepoint on Office365 with Go
package main
import (
"fmt"
"io/ioutil"
"net/http"
"log"
"regexp"
"strings"
)
@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 => {
@novalagung
novalagung / AndroidAdMobView.js
Created March 13, 2017 00:45 — forked from kritikinfo/AndroidAdMobView.js
gist showing Admob Banner Ad use within react native. It's not perfect, but it works. Not included: build.gradle which needs dependency on play-services-ads.
var { PropTypes, requireNativeComponent } = require('react-native');
var React = require('react-native')
var {
StyleSheet,
View,
} = React;
var iface = {
name: 'AdmobView',
@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>