Skip to content

Instantly share code, notes, and snippets.

View raizal's full-sized avatar

Raizal I.N. Pregnanta raizal

View GitHub Profile
@raizal
raizal / README-Template.md
Created August 26, 2017 06:07 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@raizal
raizal / retreive-passed-parameter-on-page-load.js
Created July 30, 2017 20:52
Retreive parameter named "url" that's passed on BrowserWindow initiation
var url = require('electron').remote.getCurrentWindow().webContents.browserWindowOptions.url;
onload = () => {
const webview = document.querySelector('webview')
webview.src = url;
}
@raizal
raizal / electron-sample-passing-data.js
Last active July 30, 2017 20:50
Passing data on Electron Window initiation
var url = "http://localhost"
var window = new electron.BrowserWindow({
width: width, height: height,
x: display.bounds.x,
y: display.bounds.y,
frame: false,
fullscreen: true,
show: true,
resizable: false,
url : wUrl
@raizal
raizal / SlideShowItemFragment.java
Last active March 11, 2016 11:01
Simple Slide Show
package com.superbro.myride.search.view;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
@raizal
raizal / LocalAddress.java
Last active November 9, 2015 07:30
Java-LocalAddress
public static InetAddress[] getLocalInetAddress() {
ArrayList<InetAddress> addresses = new ArrayList<InetAddress>();
try {
Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces();
while( en.hasMoreElements()) {
NetworkInterface intf = en.nextElement();
for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {
InetAddress inetAddress = enumIpAddr.nextElement();
if (!inetAddress.isLoopbackAddress()) {
addresses.add(inetAddress);
@raizal
raizal / AndroidManifest.xml
Created July 9, 2014 09:55
Android Manifest example With ZXing as library
<uses-permission android:name="android.permission.CAMERA"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity android:name="com.google.zxing.client.android.CaptureActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"