Skip to content

Instantly share code, notes, and snippets.

View goFrendiAsgard's full-sized avatar

Go Frendi Gunawan goFrendiAsgard

View GitHub Profile
@JunaidQadirB
JunaidQadirB / config.php
Created May 22, 2014 07:36
Enable Class loading with Namespaces in CodeIgniter
/*
* Append this to the end of your application/config.php
* @see http://stackoverflow.com/questions/3700626/namespace-in-php-codeigniter-framework#21858556
*/
spl_autoload_extensions('.php'); // Only Autoload PHP Files
spl_autoload_register(function($classname) {
if (strpos($classname, '\\') !== false) {
@duncansmart
duncansmart / progressive-ace.htm
Created March 28, 2013 23:29
Integrating ACE Editor in a progressive way
<textarea name="my-xml-editor" data-editor="xml" rows="15"></textarea>
...
<textarea name="my-markdown-editor" data-editor="markdown" rows="15"></textarea>
...
<script src="//d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js"></script>
<script>
// Hook up ACE editor to all textareas with data-editor attribute
$(function () {
@goFrendiAsgard
goFrendiAsgard / Setup_Aptana.txt
Created October 20, 2012 05:59
Using Aptana as killer web-app (and python) IDE
Aptana is a killer editor, the one IDE to rule everything in web realms. It support PHP, Python, Rubby, Python, Javascript, CSS and HTML. It's free, so you can just use it and start to do wonderful things.
Base installation :
1. Install Eclipse
2. Run eclipse
3. Go to: Help > Install New Software
4. Press Add button
5. Add Location "http://download.aptana.com/studio3/plugin/install", name it as "Aptana Plugin" or whatever
6. Back to Help > Install New Software (or just close the previous dialog)
7. Choose "Aptana Plugin" in Work With input
@goFrendiAsgard
goFrendiAsgard / register.php
Created October 2, 2012 04:02
No-CMS upload file technique to avoid duplicate file name
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// you can also extends CI_Controller for normal CodeIgniter code
class Register extends CMS_Controller{
// this is the upload path
$upload_path = BASEPATH.'../modules/ssc/assets/upload/';
// this is how to use it
public function upload(){
$file = $_FILES['user_file'];
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 9, 2024 06:43
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname