Skip to content

Instantly share code, notes, and snippets.

View remoharsono's full-sized avatar

Remo Harsono remoharsono

View GitHub Profile
<!DOCTYPE HTML>
<!--
/*
* Remote File Copy Demo 1.0
*
* Copyright 2012, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
<?php
// Twitter Auto-follow Script by Dave Stevens - http://davestevens.co.uk
$user = "";
$pass = "";
$term = "";
$userApiUrl = "http://twitter.com/statuses/friends.json";
@remoharsono
remoharsono / php_mysql_pk_dropper.php
Created October 21, 2014 06:14
PHP - MySQL Primary Key Dropper
<?php
$database_list = array('db_test_1', 'db_test_2');
echo 'Primary Key Dropper for MySQL' . "\n\n";
$link = mysql_connect('localhost', 'root', '');
if (!$link) {
echo 'Could not connect to database server: ' . mysql_error() . "\n";
exit;
var locations = [
['Bondi Beach', -33.890542, 151.274856, 4],
['Coogee Beach', -33.923036, 151.259052, 5],
['Cronulla Beach', -34.028249, 151.157507, 3],
['Manly Beach', -33.80010128657071, 151.28747820854187, 2],
['Maroubra Beach', -33.950198, 151.259302, 1]
];
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 10,
//Check if the placeholder is inside an iframe(nested iframe due to some sites auto refresh feature,
//if true redirect to targetUrl.
if(typeof targetUrl === 'undefined' || targetUrl === null){
targetUrl = decodeURIComponent(params["a"]);
}
if (self !== top) {
self.location.href = targetUrl;
}
//Begin:Global Parameters
@remoharsono
remoharsono / detect_change_on_range.vb
Last active August 29, 2015 14:20
Excel VBA script to detect change on certain range of cells
Private Sub Worksheet_Change(ByVal Target As Range)
Dim WatchRange As Range
Dim IntersectRange As Range
Set WatchRange = Range("A1:A10")
Set IntersectRange = Intersect(Target, WatchRange)
If IntersectRange Is Nothing Then
Else
rowNumber = Target.Row
@remoharsono
remoharsono / phpAccessBrowser.php
Last active August 29, 2015 14:20
Simple snippets to browse field information of MS Access database
<!DOCTYPE html>
<html>
<head><title>phpAccessBrowser</title>
<style>
hr {border:1px solid #ccc;}
table th,td {border:solid 1px #ccc;padding:5px;}
table tr:hover {background-color:#00ffff;}
.tablename {font-size:larger;font-weight:bold;margin-bottom:10px;background-color:#ccc;padding:5px;margin-top:-5px;}
</style>
</head>
@remoharsono
remoharsono / undoCellEntry.vb
Created May 24, 2015 09:38
Undo or change user entered value on MS Excel cell change event
Private Sub Worksheet_Change(ByVal Target As Range)
Dim columnNumber As Integer
columnNumber = Target.Column
If columnNumber = 10 Then
Application.EnableEvents = False
'Application.Undo
Target.Value = 0
Application.EnableEvents = True
Debug.Print "OK"
End If
<!DOCTYPE html>
<html>
<head><title></title></head>
<body>
<h3>PROVINSI</h3>
<select>
<option value="">Semua Lokasi</option><option value="17">Aceh</option>
<option value="13">Bali</option>
<option value="15">Bangka-Belitung</option>
<option value="8">Banten</option>
<?php
include 'Classes/PHPExcel.php';
$objPHPExcel = new PHPExcel();
$objPHPExcel->getActiveSheet()->setTitle('The Title');
$objPHPExcel->setActiveSheetIndex(0);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(10);