Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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
*/
<?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
*
<?php
class Foo {
public function doSomething() {
// ... 60 lines of code here....
}
}
class Bar {
protected $foo;
@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;
@toopay
toopay / face.py
Created May 3, 2013 10:04
Python Face Detect
import cv2
import sys
def detect(img,out):
color = (0,255,0)
cascade = cv2.CascadeClassifier("res/haarcascade_frontalface_alt.xml")
faces = cascade.detectMultiScale(img, 1.2, 2, 0, (100,100))
if (faces == None):
print "None found!"
else:
@toopay
toopay / face.cpp
Last active December 16, 2015 22:39
C++ Face Detect
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/objdetect/objdetect.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
const char* keys =
{
"{i|input| |The source image}"
"{d|dir| |The resource directory}"
};
{"foo":"bar","lorem":"ipsum"}
Vivas El Barca!