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
@ihsanberahim
ihsanberahim / load.php
Created October 27, 2014 05:39
My Favourite Local Developement Setting
<?php
error_reporting(E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR);
ini_set('date.timezone','Asia/Kuala_Lumpur');
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
ini_set('error_log',__DIR__.'error.log');
ini_set('track_errors',1);
ini_set('post_max_size','100M');
ini_set('upload_max_filesize','100M');
set_time_limit(0);
@ihsanberahim
ihsanberahim / auto_db_backup.bat
Last active August 29, 2015 14:07
Automate Database Backup using Mysql Workbench on Windows
set DATET=%date:~-4%_%date:~7,2%
"mysqldump.exe" --host="localhost" --user="{username}" --password="{password}" {database name} > "{folder path}"backup_%DATET%_{database name}.sql
pause
@ihsanberahim
ihsanberahim / TouchClickManager.cs
Last active August 29, 2015 14:06
Unity TouchClickManager
/*
GUIDES:
1. Attach it on "Main Camera" to use.
2. Bind your function to the system event OnCasted, OnBegan, OnMove, OnEnd
4. Make sure you add "using System.Collections.Generic" on the top of all your script
See example below "YouScript.cs"
*/
using UnityEngine;
using System.Collections;
@ihsanberahim
ihsanberahim / GameSystem.cs
Last active March 29, 2018 16:39
Unity SoundsManager
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class GameSystem : MonoBehaviour {
void Start()
{
//Always call the init function first to use SoundsManager component
SoundsManager.init();
@ihsanberahim
ihsanberahim / csOne.cs
Last active August 29, 2015 14:06
Add both the Js and the C# script to a same GameObject
using Unity.Engine;
using System.Collection;
public class csOne : MonoBehaviour
{
public jsOne jsOneClass;
void Start()
{
jsOneClass = GetComponent("jsOne");
@ihsanberahim
ihsanberahim / AndroidManifest.xml
Created September 12, 2014 02:49
Unity Banner Ads not clickable
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" android:installLocation="preferExternal" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19" />
<!-- Mandatory permission -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- Optional, but without them, you might get less ads and tracking could be less accurate -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
@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)
@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 / 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 / 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()
{
}