Skip to content

Instantly share code, notes, and snippets.

View adisetiawan's full-sized avatar
🏠
Working from home

Adi adisetiawan

🏠
Working from home
View GitHub Profile
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

<?php
session_start();
if(!isset($_SESSION['firsttime'])) {
//user first time visit
$_SESSION['firstime'] = true;
//do whatever you want
} else {
} //user already visit this page
?>
#!/bin/sh
MONGODB_SHELL='mongo'
DUMP_UTILITY='mongodump'
#SET the bd name which one you want to backup
DB_NAME=''
#SET server path where you want to save the file
CLOUD_PATH=''
@adisetiawan
adisetiawan / openvpn.md
Created September 26, 2013 06:06 — forked from padde/openvpn.md

OpenVPN on Ubuntu 12.10 at DigitalOcean

Install OpenVPN

sudo apt-get install openvpn

Generate Server Certificates

sudo cp -r /usr/share/doc/openvpn/examples/easy-rsa/2.0 /etc/openvpn/easy-rsa2

cd /etc/openvpn/easy-rsa2

I managed to make Codeiniter work with HHVM, using
nginx as a proxy. My problem was that hhvm has problems
with path_info, so I was not able to run /index.php/controller/action or
/controller/action/params -> /index.php/controller/action.params.
I used nginx as a proxy to hhvm. I changed the way codeigniter process
the url. Steps bellow:
Cleaned my HHVM .hdf file:
Server {
/* ============================================
* bootstrap-infiniteScroll.js
* ============================================ */
!function ($) {
'use strict';
var InfiniteScroll = function (el, options) {
this.$element = $(el);
this.$data = $(el).data();
this.$options = options;
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb
sudo dpkg -i elasticsearch-1.0.1.deb
<?php
/**
* This script is for easily deploying updates to Github repos to your local server. It will automatically git clone or
* git pull in your repo directory every time an update is pushed to your $BRANCH (configured below).
*
* Read more about how to use this script at http://behindcompanies.com/2014/01/a-simple-script-for-deploying-code-with-githubs-webhooks/
*
* INSTRUCTIONS:
* 1. Edit the variables below
* 2. Upload this script to your server somewhere it can be publicly accessed
<?php
namespace WCM;
# USES PHP 5.3 + Closures
// No white surrounding space
$data = array_map( 'trim', $_POST['foo'] );
$data = filter_var_array( $data, array(