Skip to content

Instantly share code, notes, and snippets.

View broklyngagah's full-sized avatar

pieter lelaona broklyngagah

  • Rebelworks
  • Jakarta
View GitHub Profile

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@broklyngagah
broklyngagah / .gitignore
Last active August 29, 2015 14:17 — forked from octocat/.gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
var elixir = require('laravel-elixir');
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var minify = require('gulp-minify-css');
var _ = require('underscore');
/*
|--------------------------------------------------------------------------
| Uglify Task
|--------------------------------------------------------------------------
<?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
<?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.
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);
@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,
#!/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 / 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.
@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;