Skip to content

Instantly share code, notes, and snippets.

@atishgoswami
atishgoswami / getter-setter.php
Last active November 16, 2015 07:30
Array Getter and Setter.
<?php
/**
* Get Current Import Structure Array
*
* @param string $path path to array key
*
* @return void
*/
protected function _getCurrentImportStructure($path = null)
{
@atishgoswami
atishgoswami / entites.php
Created August 21, 2015 13:31
HTML Entities
<?php
$arr = array(
'"' => '&quot;',
''' => '&apos;',
'&' => '&amp;',
'¡' => '&iexcl;',
'¢' => '&cent;',
'£' => '&pound;',
'¤' => '&curren;',
'¥' => '&yen;',
@atishgoswami
atishgoswami / settings.json
Last active August 29, 2015 14:22
Sublime Text User Settings
{
"draw_minimap_border": true,
"font_face": "Ubuntu Mono",
"word_wrap": "false",
"font_options":
[
"no_italic"
],
"font_size": 16.0,
"ignored_packages":
@atishgoswami
atishgoswami / deploy.php
Created May 3, 2015 00:54
BitBucket Deployment
<?php
// Set these dependant on your BB credentials
$username = 'username';
$password = 'password';
// Grab the data from BB's POST service and decode
$json = stripslashes($_POST['payload']);
$data = json_decode($json);
@atishgoswami
atishgoswami / csscount.js
Created April 10, 2015 08:08
Counts CSS rules
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
@atishgoswami
atishgoswami / magento-bash.sh
Created November 21, 2014 13:47
Magento Module Scarfold Generator
#!/bin/bash
NAMESPACE=$1;
MODULE=$2;
HELPER="";
/bin/mkdir -p $NAMESPACE/$MODULE/etc/ \
$NAMESPACE/$MODULE/sql/ \
$NAMESPACE/$MODULE/sql/$NAMESPACE"_"$MODULE"_setup" \
$NAMESPACE/$MODULE/controllers/Adminhtml/ \
@atishgoswami
atishgoswami / grid.css
Created July 6, 2014 22:15
Grid Pattern Css
/*imports*/
.row { float: left; clear: both; width: 100%; }
.container .columns { float: left; padding-right: 1em; padding-left: 1em; }
.container .columns.one, .container .columns.two, .container .columns.three, .container .columns.four, .container .columns.five, .container .columns.six, .container .columns.seven, .container .columns.eight, .container .columns.nine, .container .columns.ten, .container .columns.eleven, .container .columns.twelve, .container .columns.thirteen, .container .columns.fourteen, .container .columns.fifteen, .container .columns.sixteen { width: 100%; }
.container { width: 100%; }
.clearfix:after, .container:after { content: ''; display: block; overflow: hidden; visibility: hidden; width: 0; height: 0; clear: both; }
@atishgoswami
atishgoswami / .bashrc
Last active November 16, 2021 03:26
Git Prompt for Ubuntu .bashrc
# Configure colors, if available.
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
c_reset='\[\e[0m\]'
c_user='\[\033[1;37m\]'
c_path='\[\e[0;33m\]'
c_git_clean='\[\e[0;36m\]'
c_git_dirty='\[\e[0;35m\]'
else
c_reset=
c_user=
@atishgoswami
atishgoswami / virtualhost
Last active January 4, 2016 11:08
New Apache2 new host file
<VirtualHost *:80>
DocumentRoot [path to document]
ServerName [domain name]
ServerAlias [aliases]
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
@atishgoswami
atishgoswami / Help.txt
Last active December 29, 2015 23:09
Vim Sublime Patching
PROMPT_COMMAND='PS1="${c_user}\u${c_reset}@${c_user}\h${c_reset} ⎇ [${c_path}\w${c_reset}$(git_prompt)]
→ "'
https://dbrgn.ch/slides/20130207_getting_git/#/
Go To:
https://github.com/grigio/vim-sublime
Steps:
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle - Installs Vundle