Skip to content

Instantly share code, notes, and snippets.

View broklyngagah's full-sized avatar

pieter lelaona broklyngagah

  • Rebelworks
  • Jakarta
View GitHub Profile
@broklyngagah
broklyngagah / beanstalkd.config
Created September 2, 2016 13:04 — forked from mattzuba/beanstalkd.config
beanstalkd.config
sources:
/tmp: https://github.com/kr/beanstalkd/archive/v1.10.tar.gz
commands:
01_make_beanstalkd:
cwd: /tmp/beanstalkd-1.10
command: make
02_install_beanstalkd:
cwd: /tmp/beanstalkd-1.10
@broklyngagah
broklyngagah / phalconphp_php7_ubuntu_16_04.sh
Created July 9, 2016 17:52 — forked from Tosyn/phalconphp_php7_ubuntu_16_04.sh
PhalconPhp with PHP7 Installation on Ubuntu 16.04
#!/bin/bash
# PhalconPhp with PHP7 installation on ubuntu:16.04
sudo apt-get update
sudo apt-get install -y php7.0-fpm \
php7.0-cli \
php7.0-curl \
php7.0-gd \
# Thanks to this post:
# http://blog.ikato.com/post/15675823000/how-to-install-consolas-font-on-mac-os-x
$ brew install cabextract
$ cd ~/Downloads
$ mkdir consolas
$ cd consolas
$ curl -O http://download.microsoft.com/download/f/5/a/f5a3df76-d856-4a61-a6bd-722f52a5be26/PowerPointViewer.exe
$ cabextract PowerPointViewer.exe
$ cabextract ppviewer.cab
@broklyngagah
broklyngagah / custom.js
Created February 5, 2016 09:33 — forked from jonhkr/custom.js
Loading Bootstrap`s modal content trough ajax with ladda loading buttons (http://lab.hakim.se/ladda/) support
$(function() {
$('[data-toggle="modal"]').on('click', function(e) {
e.preventDefault();
var url = $(this).attr('href');
if (!url.indexOf('#') == 0) {
var l = Ladda.create(this);
var modal, modalDialog, modalContent;
@broklyngagah
broklyngagah / bumpversion.sh
Created February 2, 2016 14:33 — forked from pete-otaqui/bumpversion.sh
Bump a software project's VERSION, add the CHANGES, and tag with GIT
#!/bin/bash
# works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "1.2.3"
# this script will display the current version, automatically
# suggest a "minor" version update, and ask for input to use
# the suggestion, or a newly entered value.
#!/usr/bin/env zsh
branch=`git rev-parse --abbrev-ref HEAD`
git show-branch | ack '\*' | ack -v "$branch" | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//'
# How it works:
# 1| Display a textual history of all commits.
# 2| Ancestors of the current commit are indicated
# by a star. Filter out everything else.
@broklyngagah
broklyngagah / query.md
Created December 20, 2015 00:40
Phalcon Query Builder Expression

I have a query like this (native sql)

SELECT
	DISTINCT(P.product_variant_code) AS product_variant_code,
	P.product_name AS product_name,
	P.variant_name AS variant_name,
	P.is_host_to_host AS is_host_to_host,
	P.has_child AS has_child,
	P.variant_options AS variant_options,
public function headers($name, $default = null)
{
if($name == self::AUTH_CONST_NAME) {
$all = apache_request_headers();
if (isset($all['Authorization'])) {
return $all['Authorization'];
}
}
return $this->getHeader($name);
<?php namespace Indomog\Machine\DB\Annotation;
use Phalcon\Db\Column;
use Phalcon\DiInterface;
use Phalcon\Mvc\Model\MetaData as PhalconMetadata;
use Phalcon\Mvc\Model\MetaData\StrategyInterface;
use Phalcon\Mvc\ModelInterface;
/**
* Annotations metadata reader.
<?php
use Phalcon\Mvc\Controller;
use Phalcon\Mvc\Dispatcher;
use Phalcon\Mvc\DispatcherInterface;
use Phalcon\Mvc\Model\CriteriaInterface;
use Phalcon\Mvc\ModelInterface;
use Phalcon\Mvc\View;
abstract class RestController extends Controller