Skip to content

Instantly share code, notes, and snippets.

View rifki's full-sized avatar
Working from home

rifki rifki

Working from home
View GitHub Profile
@rifki
rifki / test.php
Created November 5, 2011 15:11
testing
<?php
class Test
{
private $log;
private $loc;
public function __construct(){}
public function getLog(){}
public function setLog(){}
public function getLoc(){}
public function setLoc(){}
@rifki
rifki / gist:3760700
Created September 21, 2012 09:56
GET Request
<?php
/**
* maintain....
* pages for GET request
*
* @author rifki
*/
class SayHello
@rifki
rifki / gist:3798636
Created September 28, 2012 08:26
google maps API
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 500px }
body { height: 500px; margin: 0; padding: 0 }
#map_canvas { height: 100% }
</style>
<script type="text/javascript"
@rifki
rifki / gist:3798659
Created September 28, 2012 08:33
Environment Class
<?php
/**
* Copyright @author Muhamad Rifki <rifki@rifkilabs.net>
* Deskripsi : http://php.net/manual/en/reserved.variables.server.php
*/
abstract class EnvironmentAbstract
{
/**
@rifki
rifki / splqueue.php
Last active December 13, 2015 20:29
SPLStack & SplQueue
<?php
$doublyList = new SplQueue();
if ($doublyList->isEmpty()) {
$doublyList->enqueue('PHP');
$doublyList->enqueue('Java');
$doublyList->enqueue('Python');
$doublyList->enqueue('Ruby');
}
@rifki
rifki / latestaticbinding.php
Last active December 13, 2015 20:38
Late Static Binding
<?php
class SuzukiSatria120R
{
protected static $color = 'black';
protected static $topSpeed = 120;
protected static $type = 'Satria 120 R';
protected static $tax = '2tax';
public static function getColor()
//Ubah AboutViewController.m jadi seperti berikut:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = [UIColor greenColor];
}
@rifki
rifki / example.txt
Created December 18, 2014 13:39
Save queries Codeigniter
Issue:
https://github.com/bcit-ci/CodeIgniter/issues/1351
Config:
Global config(application/config/config.php)
code:
$db['default']['save_queries'] = FALSE;
After database initialization:
$this->db->save_queries = FALSE;
@rifki
rifki / gist:03af2da750685baefb23
Created December 18, 2014 13:44
Dumping DB & Table
##########################
Dump Table
##########################
mysqldump -hhostnya -uusernya -p namadbnya tablenya1 tablenya2 > /path/to/hasilnya.sql
##########################
Dump Database
##########################
mysqldump -hmyhostname -uusernya -p namadbnya > targetfilenya.sql
@rifki
rifki / nginx-common
Last active August 29, 2015 14:23
Personal config nginx
# show info
brew info nginx
# start and stop
nginx.start
nginx.stop
nginx.restart
# logs
nginx.logs.access
nginx.logs.default.access