Skip to content

Instantly share code, notes, and snippets.

View arbo77's full-sized avatar
🤧
I may be slow to respond.

Ari Wibowo arbo77

🤧
I may be slow to respond.
View GitHub Profile
@arbo77
arbo77 / location-format-converter.js
Created December 12, 2022 03:48
Convert location format from DMS to DD
function getDMS2DD(days, minutes, seconds, direction) {
direction.toUpperCase();
var dd = days + minutes/60 + seconds/(60*60);
//alert(dd);
if (direction == "S" || direction == "W") {
dd = dd*-1;
} // Don't do anything for N or E
return dd;
}
var contacts = []; // contoh 1
const bulan = [
'JAN','FEB','MAR','APR','MEI','JUN',
'JUL','AGS','SEP','OKT','NOV','DES'
]; // contoh 2
var data = new Array(10); // contoh 3
var list = new Array(10,2); // contoh 4
@arbo77
arbo77 / index.html
Created March 20, 2019 03:36
Openlayers Cluster
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="stylesheet" href="http://dev.openlayers.org/theme/default/style.css" type="text/css">
<link rel="stylesheet" href="http://dev.openlayers.org/examples/style.css" type="text/css">
<script src="http://dev.openlayers.org/OpenLayers.js"></script>
@arbo77
arbo77 / read.js
Created June 11, 2018 00:28 — forked from sjcotto/read.js
function isChatMessage(message) {
if (message.__x_isSentByMe) {
return false;
}
if (message.__x_isNotification) {
return false;
}
if (!message.__x_isUserCreatedType) {
return false;
}
@arbo77
arbo77 / pg_func_list.sql
Created February 11, 2018 17:25
PostgreSQL Procedure List
SELECT n.nspname AS schema
,proname AS fname
,proargnames AS args
,t.typname AS return_type
,pg_get_functiondef(p.oid) as definition
FROM pg_proc p
JOIN pg_type t
ON p.prorettype = t.oid
LEFT OUTER
JOIN pg_description d
@arbo77
arbo77 / contenteditable.js
Created April 19, 2017 21:01
AngularJS contentditable directive
app.directive('edit', function() {
return {
restrict: 'A',
require: 'ngModel',
scope: {
state: '=state',
},
link: function(scope, element, attrs, ngModel) {
function read() {
@arbo77
arbo77 / base.css
Last active January 29, 2017 08:39
For electron Typography
html, body, .full{
height: 100%;
padding: 0;
margin: 0;
}
/* Webfont: Lato-Black */@font-face {
font-family: 'Lato';
src: url('fonts/Lato-Black.eot'); /* IE9 Compat Modes */
src: url('fonts/Lato-Black.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('fonts/Lato-Black.woff2') format('woff2'), /* Modern Browsers */
@arbo77
arbo77 / kalender.sql
Created January 26, 2017 22:48
PostgreSQL 1 month calendar dates
create or replace function kalender(p_tahun int, p_bulan int) returns text LANGUAGE plpgsql
AS $function$
declare
y int;
m int;
d_start date;
d_end date;
nb int;
c int;
l text;
@arbo77
arbo77 / Get Serial Number
Last active January 8, 2016 17:42
Android Snippet
Class<?> c = Class.forName("android.os.SystemProperties");
Method get = c.getMethod("get", String.class, String.class);
String serialNumber = (String) get.invoke(c, "sys.serialnumber", "Error");
if(serialNumber.equals("Error")) {
serialNumber = (String) get.invoke(c, "ril.serialnumber", "Error");
}
@arbo77
arbo77 / interfaces
Created January 25, 2015 14:57
Qemu KVM
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto virbr0
iface virbr0 inet static