Skip to content

Instantly share code, notes, and snippets.

View natali's full-sized avatar

Natali Ardianto natali

View GitHub Profile
@natali
natali / jne.php
Created September 9, 2012 13:48
Cek resi TIKI JNE/TIKI
<html>
<head>
<title>Check AWB</title>
<style type="text/css">
BODY, TD, INPUT {
font-family:Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
}
INPUT.submit {
@natali
natali / strtr.php
Created May 27, 2012 04:49
Sucky php function
$page_output = strtr($page_output, $this->translations);
@natali
natali / get_zip_code.php
Created February 18, 2011 10:09
Try dialing to +990009369991456895 using Skype (free) to see this script in action.
<?php
// Include Tropo classes.
require('tropo.class.php');
// Include Limonade framework.
require('lib/limonade.php');
// The URL to the Google weather service. Renders as XML doc.
define("GOOGLE_WEATHER_URL", "http://www.google.com/ig/api?weather=%zip%&hl=en");
@natali
natali / .bashrc
Created November 23, 2010 08:19
Send email everytime someone login to root
# put in /root/.bashrc
echo 'ALERT - Root Shell Access on:' `date` `who | grep -v "203.24.76.33"` | mail -s "Alert: Root Access from `who | awk '{print $6}'| grep -v "203.24.76.33"`" youremail@gmail.com
@natali
natali / query_for_getting_course_time.sql
Created August 3, 2010 10:35
getting the available schedules, with interval 2:20 and grace period 20 minutes.
SELECT a.plantime_id AS plantime_id1, MIN(a.plan_time) AS plan_time1,
b.plantime_id AS plantime_id2, MIN(b.plan_time) plan_time2,
c.plantime_id AS plantime_id3, MIN(c.plan_time) plan_time3,
d.plantime_id AS plantime_id4, MIN(d.plan_time) plan_time4
FROM golf__timeslots a
JOIN golf__timeslots b
ON a.business_id = b.business_id
AND a.plan_date = b.plan_date
AND b.availability = 'available'
AND b.course_id = '1'
<?php
$total = 0;
$array1 = Array ( [tgl] => 07 [01] => 968 [total] => 35801 [02] => 29413 [03] => 731 [04] => 1172 [05] => 799 [06] => 1046 [07] => 1672 );
$array2 = Array ( [tgl] => 07 [01] => 820 [total] => 10949 [02] => 6042 [03] => 1067 [04] => 946 [05] => 915 [06] => 834 [07] => 325 );
// versi sederhana
unset($array1['tgl']);
$total += array_sum($array1);
unset($array2['tgl']);