Skip to content

Instantly share code, notes, and snippets.

View hndr91's full-sized avatar

Afif Hendrawan hndr91

  • Malang, ID
View GitHub Profile
@hndr91
hndr91 / UNTUK_PATI_API.md
Last active October 25, 2015 09:04
Pati Directory Listing API

TYPE

/type

REST request for service type. Provides method for finding, creating, modifiying service type.

Method

  • POST

    Create new service type

    • acceptable request format: application/x-www-form-urlencoded
    • acceptable request params:
@hndr91
hndr91 / brosense-v2-remove-label.xml
Created November 18, 2015 14:54
Brosense V2 Custom
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html b:version='2' class='v2' expr:dir='data:blog.languageDirection' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>
<head>
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"> </script>
<![endif]-->
<meta content='width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1' name='viewport'/>
<meta content='text/html;charset=UTF-8' http-equiv='Content-Type'/>
@hndr91
hndr91 / config.php
Last active December 9, 2015 09:41
slim-mongo config
<?php
//Database Constant
define('DB_NAME', 'test'); //db name
define('DB_COLLECTION','friends'); //collection name
//Return Paramater Constant
define('INSERT_COL_SUCCESS', 0);
define('INSERT_COL_FAILED', 1);
define('REMOVE_FRIEND_SUCCESS', 0);
define('REMOVE_FRIEND_FAILED', 1);
@hndr91
hndr91 / dbConnect.php
Last active December 9, 2015 09:44
slim mongo dbConnect
<?php
class dbConnect {
private $con;
private $db;
function __construct() {}
//connect to MongoDB function
function connect() {
include_once dirname(__FILE__) . '/config.php';
@hndr91
hndr91 / dbHandler.php
Last active December 9, 2015 09:48
slim mongo dbHandler
<?php
class dbHandler {
private $con;
private $col;
function __construct() {
require_once dirname(__FILE__) . '/dbConnect.php';
$db = new dbConnect();
//Connect to database
$this->con = $db->connect();
//Select "friends" collection, already defined in config.php
@hndr91
hndr91 / index.php
Last active December 9, 2015 10:12
<?php
require_once '/include/dbHandler.php';
require_once '/lib/Slim/Slim/Slim.php';
Slim\Slim::registerAutoloader();
$app = new Slim\Slim();
//Get All friends end point
$app->get('/friends', function() {
$db = new dbHandler();
$cur = $db->getAllFriends();
//Variable to store result
@hndr91
hndr91 / genymotionwithplay.txt
Created January 6, 2016 17:11 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
@hndr91
hndr91 / index.php
Created January 28, 2016 13:03
Routing Slim
<?php
require 'vendor/autoload.php' //fitur autoload composer
//Inisiasi Slim Framewrok
$app = new \Slim\Slim();
//home routing
$app->get('/', function(){
echo "Home Base"; //print "Home Base" at http://localhost/slim
});
@hndr91
hndr91 / .htaccess
Last active May 12, 2016 18:17
.htaccess Slim
RewriteEngine On
# Some hosts may require you to use the `RewriteBase` directive.
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
#
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
@hndr91
hndr91 / .htaccess
Created January 28, 2016 13:13
.htaccess Slim with RewriteBase
RewriteEngine On
# Some hosts may require you to use the `RewriteBase` directive.
# If you need to use the `RewriteBase` directive, it should be the
# absolute physical path to the directory that contains this htaccess file.
#
RewriteBase /slim
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f