Skip to content

Instantly share code, notes, and snippets.

View dwihujianto's full-sized avatar
🌴
On vacation

Dwi Hujianto dwihujianto

🌴
On vacation
View GitHub Profile
@dwihujianto
dwihujianto / InsertBatch.php
Created October 8, 2015 05:18
Insert Batch
<?php
$names = array(
'Wiro',
'Sableng',
'Joko',
'Sembung',
'Iwan',
'Tono',
'Cahyadi',
'Panji',
@dwihujianto
dwihujianto / NamespaceAutoload.php
Created October 8, 2015 12:10
Autoload with Namespace
<?php
spl_autoload_register(function($class){
$path = str_replace('\\', '/', $class);
require_once $path.'.php';
});
/* Namespace must same with your directory */
use Core\Common\Router;
@dwihujianto
dwihujianto / indonesiandate_helper.php
Created November 12, 2015 06:56
Helper tanggal indonesia (Codeigniter 3.03)
<?php defined('BASEPATH') OR exit('Forbbiden');
if (! function_exists('indodate'))
{
function indodate($date='')
{
$Arrmonth = [
1 => 'Januari',
2 => 'Februari',
3 => 'Maret',
@dwihujianto
dwihujianto / form.html
Created November 14, 2015 13:19
Multifield update
<pre>
<form action="post.php" method="POST">
Kode <input type="text" name="_id[]">
Nama <input type="text" name="_nama[]">
Kode <input type="text" name="_id[]">
<?php
class Math
{
protected $result = 0;
public function plus($value)
{
$this->result += $value;
return $this;
@dwihujianto
dwihujianto / OOPSOAP.php
Created December 24, 2015 15:11
Create Soap (MyStyle)
<?php
/**
* @author Dwi Hujianto <[email protected]>
*/
require_once 'lib/nusoap.php';
class Resourceapi extends soap_server
{
/**
public function services()
{
if (! $this->input->is_ajax_request())
{
show_404();
}
$data = [
'nama' => 'Nganu',
'alamat' => 'Yogya'
@dwihujianto
dwihujianto / instafeedjsaccess.md
Created July 28, 2016 06:56 — forked from mojaray2k/instafeedjsaccess.md
Getting Instagram Access Token for http://intafeedjs.com

#Use this URL to get your client authorized for Instafeed.JS plugin for Instagram.

  1. First login into your Instargam account
  2. Then go to https://www.instagram.com/developer/
  3. At the top click on the Button that says "Manage Clients".
  4. If you have not Register a new client.
  5. Fill out everything and where it says redirect url put this url: http://instafeedjs.com
  6. Then on the security tab make sure you uncheck "Disable implicit OAuth"
  7. Finally use this link to authoruize Instafeed. Where it says "[Client ID]" replace that including the brackets with your clientID from instagram:
  8. https://instagram.com/oauth/authorize/?client_id=[Client ID]&redirect_uri=http://instafeedjs.com&amp;response_type=token
@dwihujianto
dwihujianto / README-Template.md
Created November 9, 2016 06:14 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@dwihujianto
dwihujianto / gist:c13ed84a0172b86d0fe0531d4bd5ef93
Created January 17, 2017 08:08 — forked from excalq/gist:2961415
Javacript: Set or Update a URL/QueryString Parameter, and update URL using HTML history.replaceState()
// Explicitly save/update a url parameter using HTML5's replaceState().
function updateQueryStringParam(param, value) {
baseUrl = [location.protocol, '//', location.host, location.pathname].join('');
urlQueryString = document.location.search;
var newParam = key + '=' + value,
params = '?' + newParam;
// If the "search" string exists, then build params from it
if (urlQueryString) {
keyRegex = new RegExp('([\?&])' + key + '[^&]*');