Skip to content

Instantly share code, notes, and snippets.

View hanafiah's full-sized avatar
🏠
Working from home

Muhamad Hanafiah Yahya hanafiah

🏠
Working from home
View GitHub Profile
@hanafiah
hanafiah / ratio.php
Last active December 22, 2015 04:26
<?php
function GCD($a, $b)
{
while ( $b != 0)
{
$remainder = $a % $b;
$a = $b;
$b = $remainder;
}
return abs ($a);
<script>
function beli() {
dataLayer.push({
'event': 'GTM.beli',
'ecommerce': {
'purchase': {
'actionField': {
'id': 'T12345', // Transaction ID. Required for purchases and refunds.
'affiliation': 'Online Store',
'revenue': '35.43', // Total transaction value (incl. tax and shipping)
<Item>
<ASIN>B013XJHGH4</ASIN>
<ParentASIN>B010283OG6</ParentASIN>
<SmallImage>
<URL>http://ecx.images-amazon.com/images/I/41HhdML54fL._SL75_.jpg</URL>
<Height Units="pixels">75</Height>
<Width Units="pixels">58</Width>
</SmallImage>
<MediumImage>
<URL>http://ecx.images-amazon.com/images/I/41HhdML54fL._SL160_.jpg</URL>
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)$ http://ioads.linktrackr.com/$1 [r=301,nc]
<Files .htaccess>
order allow,deny
deny from all
</Files>
Options All -Indexes
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)$ https://ioads.rurl.me/$1 [r=301,nc]
<Files .htaccess>
order allow,deny
deny from all
</Files>
Options All -Indexes
@hanafiah
hanafiah / roundup issue.php
Last active July 13, 2016 04:48
round up issue
<?php
/**
* problem solved.
* thanks
**/
$spp002 = 1.70;
$bizhubC360 = 1;
$InPage = 45;
$r = ($spp002 + $bizhubC360) / $InPage;
@hanafiah
hanafiah / raspberry pi digi huawei E5577s.sh
Created August 11, 2016 23:33
Setting up internet over usb on Raspberry Pi
pi@raspberrypi:~ $ lsusb
Bus 001 Device 004: ID 046d:c534 Logitech, Inc.
Bus 001 Device 006: ID 12d1:14dc Huawei Technologies Co., Ltd.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@raspberrypi:~ $ sudo nano /etc/usb_modeswitch.conf
#--------------------------
pi@raspberrypi:~ $ iw list
Wiphy phy0
max # scan SSIDs: 10
max scan IEs length: 2048 bytes
Retry short limit: 7
Retry long limit: 4
Coverage class: 0 (up to 0m)
Device supports roaming.
Device supports T-DLS.
Supported Ciphers:
pi@raspberrypi:~ $ sudo nano /etc/network/interfaces
#--------------------------
iface wlan0 inet static
address 192.168.8.200
netmask 255.255.255.0
network 192.168.8.1
post-up echo 1 /proc/sys/net/ipv4/ip_forward
#--------------------------
pi@raspberrypi:~ $ sudo apt-get install -y debconf-utils
Reading package lists... Done
Building dependency tree
Reading state information... Done
debconf-utils is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~ $ sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password raspbian'
pi@raspberrypi:~ $ sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password raspbian'