Skip to content

Instantly share code, notes, and snippets.

View novalagung's full-sized avatar
🏠

Noval Agung Prayogo novalagung

🏠
View GitHub Profile
@nanmu42
nanmu42 / openinbrowser.go
Created May 20, 2019 09:43
Golang: Open URL in Browser
func openBrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
err = exec.Command("open", url).Start()
@acdlite
acdlite / app.js
Last active January 20, 2023 08:23
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 => {
@kritikinfo
kritikinfo / AndroidAdMobView.js
Last active October 18, 2019 08:49
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',
@michaljemala
michaljemala / tls-client.go
Last active April 10, 2024 01:57
SSL Client Authentication Golang sample
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)