Skip to content

Instantly share code, notes, and snippets.

View bendo01's full-sized avatar

Benny Leonard Enrico Panggabean bendo01

View GitHub Profile
@bendo01
bendo01 / macports.nginx.txt
Created November 2, 2011 11:22
MacPorts install nginx & php
# Download & install marports http://www.macports.org/install.php
$ sudo port selfupdate
$ sudo port install nginx
$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.nginx.plist
$ sudo port install php5 +fastcgi fcgi
$ sudo mkdir /opt/local/etc/LaunchDaemons/org.macports.php-fastcgi
$ cd /opt/local/etc/LaunchDaemons/org.macports.php-fastcgi
$ mate org.macports.php-fastcgi.plist # or vim org.macports.php-fastcgi.plist
@bendo01
bendo01 / prime.html
Created November 11, 2011 15:19 — forked from timw4mail/prime.html
Javascript prime number generator
<!DOCTYPE html>
<html>
<head>
<title>JS Prime Generator</title>
</head>
<body>
<div id="res"></div>
<button id="generate">Generate more primes!</button>
<script type="text/javascript">
(function(){
@bendo01
bendo01 / bootstrap_form.php
Created November 22, 2011 06:35 — forked from slywalker/bootstrap_form.php
form helper for CakePHP on twitter bootstrap
<?php
class BootstrapFormHelper extends AppHelper {
public $helpers = array('Html', 'Form');
public function input($name, $options = array()) {
$default = array(
'type' => null,
'label' => null,
'before' => null, // to convert .input-prepend
@bendo01
bendo01 / pagination.ctp
Created November 22, 2011 06:46 — forked from slywalker/pagination.ctp
pagination element for CakePHP on twitter bootstrap
<?php
if (!isset($modules)) {
$modulus = 11;
}
if (!isset($model)) {
$models = ClassRegistry::keys();
$model = Inflector::camelize(current($models));
}
?>
<div class="pagination">
@bendo01
bendo01 / gist:2313232
Created April 5, 2012 18:56 — forked from tanakahisateru/gist:1344162
PHP5.4 configure with MacPorts besides existing PHP
./configure \
--prefix=/opt/local/php/5.4 \
--bindir=/opt/local/bin \
--with-config-file-path=/opt/local/php/5.4/etc \
--with-config-file-scan-dir=/opt/local/php/5.4/var/db \
--mandir=/opt/local/php/5.4/share/man \
--infodir=/opt/local/php/5.4/share/info \
--program-suffix=-5.4 \
--with-apxs2=/opt/local/apache2/bin/apxs \
--enable-pdo \
@bendo01
bendo01 / gist:2384730
Created April 14, 2012 14:23 — forked from tanakahisateru/gist:1344162
PHP5.4 configure with MacPorts besides existing PHP
./configure \
--prefix=/opt/local/php/5.4 \
--bindir=/opt/local/bin \
--with-config-file-path=/opt/local/php/5.4/etc \
--with-config-file-scan-dir=/opt/local/php/5.4/var/db \
--mandir=/opt/local/php/5.4/share/man \
--infodir=/opt/local/php/5.4/share/info \
--program-suffix=-5.4 \
--with-apxs2=/opt/local/apache2/bin/apxs \
--enable-pdo \
@bendo01
bendo01 / proxy_nginx.sh
Created April 18, 2012 10:45 — forked from rdegges/proxy_nginx.sh
Create a HTTP proxy for jenkins using NGINX.
sudo aptitude -y install nginx
cd /etc/nginx/sites-available
sudo rm default
sudo cat > jenkins
upstream app_server {
server 127.0.0.1:8080 fail_timeout=0;
}
server {
listen 80;
@bendo01
bendo01 / build.xml
Created May 1, 2012 16:09 — forked from vitorpacheco/build.xml
Jenkins + CakePHP
<?xml version="1.0" encoding="UTF-8"?>
<project name="name-of-project" default="build">
<target name="build"
depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpdoc,phpcb"/>
<target name="build-parallel"
depends="prepare,lint,tools-parallel,phpcb"/>
<target name="tools-parallel"
@bendo01
bendo01 / php54_php53_pear_macports.markdown
Created June 8, 2012 08:21 — forked from jbeduya/php54_php53_pear_macports.markdown
Installing PHP 5.4 and 5.3 side by side on Max OSX via MacPorts

##Given Apache 2 and MySQL are already installed.

#Update MacPorts sudo port selfupdate;sudo port -u upgrade outdated

#Install PHP 5.4.* sudo port install php54 php54-apache2handler ##Activate Apache Module cd /opt/local/apache2/modules

/*
* add this to your own css file,
* to overwrite the _chosen_ styling, to look more like bootstrap!
*
* note: for the error part to work, an .error class-name must be added
* to a wrapping DIV, to display the bootstrap error styling. I have
* just use the wrapping .control-group DIV
*
* credit: Rasmus Burkal, @rabu81
* Drew Miller, @mewdriller