Skip to content

Instantly share code, notes, and snippets.

View neotohin's full-sized avatar

Amzad Hossain neotohin

View GitHub Profile
@neotohin
neotohin / php.snippets
Created August 12, 2011 17:46 — forked from aaroneaton/php.snippets
CodeIgniter PHP snippets for the VIM plugin SnipMate
# SnipMate is required to use snippets
# Download SnipMate: http://www.vim.org/scripts/script.php?script_id=2540
# Put this file in ~/.vim/snippets/ then restart vim
# This snippet file includes many useful snippets for CodeIgniter. Please feel free to fork and contribute!
snippet php
<?php
${1}
snippet ec
echo "${1:string}"${2};
snippet inc
@neotohin
neotohin / Sublimetext:Preference:User
Last active December 16, 2015 18:18
My Sublimetext editor User Settings
{
"auto_complete_commit_on_tab": false,
"bold_folder_labels": true,
"color_scheme": "Packages/User/Solarized (Light) (SL).tmTheme",
"default_line_ending": "unix",
"detect_indentation": false,
"draw_minimap_border": true,
"enable_tab_scrolling": true,
"enable_telemetry": "false",
"ensure_newline_at_eof_on_save": true,
@neotohin
neotohin / array_item.php
Last active December 17, 2015 20:49
Get reference of a specific item via sequence from a multi-dimension array.
<?php
/**
* Sample Array
*/
$arr = array(
'key_1' => array(
'key_1_1' => array(
'key_1_1_1' => array(
'key_1_1_1_1' => array(
@neotohin
neotohin / drupal.tabular.php
Created May 30, 2013 11:26
Drupal : Make fieldset Items Tabular
/**
* Implements hook_theme().
*/
function example_theme($existing, $type, $theme, $path) {
return array(
'table_layout' => array(
'render element' => 'form',
'file' => 'includes/st_chart.theme.inc'
),
);
@neotohin
neotohin / dabblet.css
Created December 26, 2013 11:50
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
.mbox{
border: 2px solid rgba(0,0,0, .3);
width: 100px;
height: 100px;
transition: 1s height;
}
@neotohin
neotohin / gitconfig
Last active January 4, 2016 08:18
My gitconfig
[user]
name =
email =
[alias]
st = status -sb
f = fetch
c = commit
p = pull
b = branch -ra
@neotohin
neotohin / vimrc
Last active August 29, 2015 13:56
My VIM configuration
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Setting Vundle Bundles
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set nocompatible
"filetype off
function! LoadVundle()
let vundle_installed=filereadable(expand('~/.vim/bundle/vundle/README.md'))
@neotohin
neotohin / gist:69d60568ffdd20486fd7
Created August 14, 2014 08:59
Vundle Installation on runtime
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Setting Vundle Bundles
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set nocompatible
"filetype off
function! LoadVundle()
let vundle_installed=filereadable(expand('~/.vim/bundle/vundle/README.md'))
@neotohin
neotohin / Drupal : Services Module
Created August 11, 2015 11:08
Guzzle based drupal7 Service request sample
<?php
require_once '../vendor/autoload.php';
use Guzzle\Http\Client as Guzzle;
use Guzzle\Plugin\Cookie\CookiePlugin;
use Guzzle\Plugin\Cookie\CookieJar\FileCookieJar;
$client = new Guzzle();
@neotohin
neotohin / metaDataWrapperHelper.php
Created December 2, 2015 07:15
Drupal MetaData Wrapper Helper
<?php
/**
* A simple closure that helps working with node fields
*
* $metadata_wrapper = entity_metadata_wrapper('node', $nid);
* $wrapper = metaDataWrapperHelper( $metadata_wrapper );
*
* $field_name = $wrapper('field_name', 'text');
*/
function metaDataWrapperHelper($wrapper){