Skip to content

Instantly share code, notes, and snippets.

View kilip's full-sized avatar
🏠
In Search of Enlightenment

Anthonius Munthi kilip

🏠
In Search of Enlightenment
View GitHub Profile
@kilip
kilip / README.md
Created October 21, 2016 00:29 — forked from tjamps/README.md
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :

@kilip
kilip / FeatureContext.php
Created April 21, 2016 08:46 — forked from pbuyle/FeatureContext.php
Behat step-definition to verify visibility (not just presence) of Drupal form elements.
<?php
use Behat\Behat\Context\ClosuredContextInterface,
Behat\Behat\Context\TranslatedContextInterface,
Behat\Behat\Context\BehatContext,
Behat\Behat\Exception\PendingException;
use Behat\Gherkin\Node\PyStringNode,
Behat\Gherkin\Node\TableNode;
/**

network indicator

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install indicator-netspeed

install chrome

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 
<VirtualHost *:80>
ServerName old.kmcmission.or.kr
DocumentRoot /home/kmcbishop/kmcmission.or.kr
</VirtualHost>
<?php
add_action( 'wp_enqueue_scripts', 'registerMyPluginScripts' );
function registerMyPluginScripts(){
wp_enqueue_script( 'myPluginScript', plugins_url('my-plugin/js/script.js',__FILE__), array('jquery'));
}
@kilip
kilip / SingletonPattern.php
Last active November 16, 2015 14:41
Singleton Design Pattern
<?php
class Counter
{
protected $count = 0;
static private $instance = null;
// protected will ensure that this class only created once
<?php
class Computer
{
protected $cpu;
protected $ram;
public function __construct($cpu,$ram)
{
$this->cpu = $cpu;
<?php
namespace Chyrius\PublicBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\HttpFoundation\Request;
use Chyrius\PublicBundle\Menu\RequestVoter;
use Symfony\Component\DependencyInjection\ContainerInterface;
class MenuBuilder
sudo apt-get install \
libxml2 \
libxml2-dev \
libssl-dev \
pkg-config \
curl \
libcurl4-nss-dev \
enchant \
libenchant-dev \
libjpeg8 \
@kilip
kilip / gist:6558471
Created September 14, 2013 03:00
Redmine - CentOS 5.9
rpm -Uvh http://rbel.co/rbel5
yum install ImageMagick-devel ImageMagick-c++-devel
gem install rmagick