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 / usefull_macports_command
Created November 4, 2011 04:46
usefull macports command
http://stackoverflow.com/questions/1817219/how-do-i-install-ruby-on-mac-leopard
port install ruby19+nosuffix
http://www.jotlab.com/2009/11/08/installing-ruby-on-rails-mysql-imagemagick-nginx-passenger-with-macports/
sudo port uninstall --follow-dependents portname
http://blog.ntrippy.net/2009/07/home-made-nginx-phusion-passenger-dep_01.html
sudo port uninstall nginx && sudo port clean nginx
//clean up all ports macports
@bendo01
bendo01 / gist:1338760
Created November 4, 2011 06:03
install ruby on rails php passenger and nginx
bennys-Mac-Pro:/ bennylep$ sudo port -fp uninstall --follow-dependents installed
bennys-Mac-Pro:/ bennylep$ clear
bennys-Mac-Pro:/ bennylep$ sudo rm -rf \
> /opt/local \
> /Applications/DarwinPorts \
> /Applications/MacPorts \
> /Library/LaunchDaemons/org.macports.* \
> /Library/Receipts/DarwinPorts*.pkg \
@bendo01
bendo01 / gist:1341480
Created November 5, 2011 13:02
server apache setting
#httpd.conf
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
@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 / php password generator
Created November 27, 2011 05:57
php password generator
<?php
substr( str_shuffle( 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$' ) , 0 , 10 );
?>
@bendo01
bendo01 / nginx.conf
Created February 7, 2012 16:56
nginx cakephp
#user nobody;
worker_processes 1;
#error_log /opt/local/logs/error.log;
#pid /opt/local/logs/nginx.pid;
events {
worker_connections 1024;
}
@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 \