Skip to content

Instantly share code, notes, and snippets.

View ihsanberahim's full-sized avatar
💭
focusing on the strong base for long term

Muhammad Nur'Ihsan Bin Berahim ihsanberahim

💭
focusing on the strong base for long term
View GitHub Profile
sudo chmod -R +a '_www allow read,write,delete,add_file,add_subdirectory,file_inherit,directory_inherit' <dir>
@ihsanberahim
ihsanberahim / org.apache.httpd.plist
Created December 13, 2013 14:54
Original apache plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<true/>
<key>Label</key>
<string>org.apache.httpd</string>
<key>EnvironmentVariables</key>
<dict>
@ihsanberahim
ihsanberahim / org.apache.httpd.plist
Created December 13, 2013 14:56
OSX Server apache plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<true/>
<key>EnvironmentVariables</key>
<dict>
<key>SERVER_INSTALL_PATH_PREFIX</key>
<string>/Applications/Server.app/Contents/ServerRoot</string>
@ihsanberahim
ihsanberahim / MyAccount.js
Last active January 1, 2016 14:29
TextInput - UI Module MyAccount - Controller Module App Theme Appcelerator 3.2.0.GA SDK
function MyAccount(_MainActivity){
/*---------------------------------
GROUP : Load Component Dependencies
----------------------------------*/
var H = require('/utils/Helper');
var C = require('/Config');
var UITextInput = require('/views/TextInput');
/*---------------------------------
@ihsanberahim
ihsanberahim / template.php
Created February 5, 2014 06:26
extract image source attribute from html string in Drupal
/**
* Author: ihsanberahim
* Author Url: http://blog.powergeng.com
* Author Facebook: http://facebook.com/ihsanberahim
*
* i found it from stackoverflow
*/
function content2src($html){
$doc = new DOMDocument();
@ihsanberahim
ihsanberahim / example.php
Last active August 29, 2015 13:57
simple code to create php menu tree. Inspired by Drupal.
<?php
require_once('menu.php');
?>
<?php load_menu() ?>
<table cellpadding="0" cellspacing="0" border="0" class="stdtable">
<colgroup>
<col class="con1">
<col class="con1">
</colgroup>
<thead>
@ihsanberahim
ihsanberahim / App.class.inc
Last active August 29, 2015 14:01
Simple Basic Singleton
class App
{
public static $instance = null;
public $instance_id = null;
public $db;
function __construct()
{
}
@ihsanberahim
ihsanberahim / helpers.js
Created August 8, 2014 07:26
use hidden iframe to check whether the url alive or dead
function checkUrl(url, callback)
{
var iframe = document.createElement('IFRAME');
iframe.src = url;
iframe.style.visibility = 'hidden';
document.body.appendChild(iframe);
iframe.onload = function()
@ihsanberahim
ihsanberahim / GameSystem.cs
Last active August 29, 2015 14:05
How to use delegate and event in Unity
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class GameSystem : MonoBehaviour
{
public delegate void Route();
public static event Route OnPlay;
@ihsanberahim
ihsanberahim / calendar.js
Created September 1, 2014 14:26
how to disable/enable and styling some date in the inline jquery calendar
var datesArray = ['2/9/2014'];
(function() {
$( "#datepicker" ).datepicker({
beforeShowDay: function (date)
{
var theday = date.getDate() +'/'+ (date.getMonth()+1) +'/'+ date.getFullYear();
var thedates = datesArray.join('|');
var bookedDateStyle = [true];
if(thedates.indexOf(theday)!=-1)