Skip to content

Instantly share code, notes, and snippets.

@toopay
toopay / detektif.php
Created May 6, 2013 14:55
Simple Spies Program
<?php
/**
* Program interogasi sederhana
*
* @author Taufan Aditya <[email protected]>
*/
class Node {
public $question;
<?php
class Foo {
public function doSomething() {
// ... 60 lines of code here....
}
}
class Bar {
protected $foo;
<?php
class Fibonaci {
/**
* Penggunaan :
* $fib = new Fibonaci();
* echo 'Angka fibonaci ke-1:'.$fib->term(1); // 0
* echo 'Angka fibonaci ke-2:'.$fib->term(2); // 1
* echo 'Angka fibonaci ke-20:'.$fib->term(20); // 4181
*
@toopay
toopay / base.php
Created June 20, 2013 15:35
Base Model Example
<?php namespace Model;
use \Gas\ORM;
use \Gas\Core;
class Base extends ORM {
/**
* Initial _init, that should be overided by sub-classes
*/
@toopay
toopay / CoverageListener.php
Created July 27, 2013 01:03
Coverage Listener to send coveralls payload at its simplest form.
<?php
/*
* This file is part of the Juriya CMF.
*
* (c) Taufan Aditya <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@toopay
toopay / composer.md
Last active September 16, 2017 13:59
Composer Explained (PHP Indonesia EMagz Draft)

Composer Explained

oleh Taufan Aditya

I. Kenapa Menggunakan Composer

a. Sekilas tentang "native" PHP

Mari kita perhatikan sejenak kode berikut ini :

@toopay
toopay / acl.php
Created December 9, 2013 03:59
Rule Access Example
return array(
'task_list' => array(
'user' => array(
'create' => 0x00, // 0000
'send_message' => 0x01, // 0001
'edit_profile' => 0x82, // 10000010
'edit_interest_cities' => 0x02, // 0010
'edit_interest_event_cat' => 0x02, // 0010
'edit_interest_comm_cat' => 0x02, // 0010
'edit_photo' => 0x02, // 0010
@toopay
toopay / organisasi.md
Last active January 1, 2016 17:29
Tentang Group, LSM dan Asosiasi (Developer) : Apa yang kita perlukan? [Pandangan tentang rencana pelembagaan PHP Indonesia]

TL;DR;

Yang kita perlukan, sebagai developer bukanlah birokrasi melainkan komunitas (yang organik).

Dengan kata lain, values yang kita junjung mestilah :

  • Meetup, Drink-Up (ngopi atau nge-bir bareng), IRC dan Forum yang aktif, lebih baik daripada Rapat
  • Organizer, lebih baik daripada Presiden Atau CEO
  • Co-working space, lebih baik daripada inkubasi

Sebagai konsekuensi-nya, legalitas badan hukum ataupun bentuk formal lain, diperlukan (dan hanya diperlukan) sejauh dia mendukung tumbuhnya kegiatan komunitas yang organik.

@toopay
toopay / install_intl.sh
Last active August 3, 2021 17:54
MAMP Intl
#!/bin/bash
# Install m4
cd /Applications/MAMP/bin/php/php5.4.10/include
wget ftp://ftp.gnu.org/gnu/m4/m4-1.4.10.tar.gz
tar -xvzf m4-1.4.10.tar.gz
cd m4-1.4.10
./configure --prefix=/usr/local/m4
make
sudo make install
@toopay
toopay / release.sh
Created March 23, 2014 18:48
Git SemVer release savant
#!/bin/bash
# Git Tag SemVer helpers
# Usage : !release <repo> <strategy>
# !release some_repo patch|minor|major
# Get arguments of repository and release strategy...
REPO=$1
if [ "" == "$2" ]
then