Skip to content

Instantly share code, notes, and snippets.

View versedi's full-sized avatar
🎯
Focusing

versedi

🎯
Focusing
View GitHub Profile
@versedi
versedi / Alternative_Flat_Dark-Markdown.tmTheme
Last active November 23, 2015 13:02
Alternative-Flat-Dark for GitGutter,Markdowns,SublimeLinter
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- Generated by: TmTheme-Editor -->
<!-- ============================================ -->
<!-- app: http://tmtheme-editor.herokuapp.com -->
<!-- code: https://github.com/aziz/tmTheme-Editor -->
<plist version="1.0">
<dict>
<key>name</key>
<string>Alternative Flat Dark Extended</string>
@versedi
versedi / MageSnippets.php
Last active December 21, 2015 21:09
Magento PHP Snippets
#Debug Layout
<?php Zend_Debug::dump($this->getLayout()->getUpdate()->getHandles()); ?>
##Get Locale Code
<?php echo strtolower(Mage::getStoreConfig('general/country/default')); ?>
## Get Skin URL
<?php echo $this->getSkinUrl('images/logo.png'); ?>
@versedi
versedi / main.css
Created January 8, 2016 21:36
Sublime Text CSS ASCII ART Sections Snippet
/*
Tool used to generate ASCII ART:
http://www.kammerl.de/ascii/AsciiSignature.php
(Font: 'georgi16')
1. RESETS
2. GENERAL REUSABLE COMPONENTS
3. TYPOGRAPHY
4. FORMS
5. HEADER
<code_scheme name="CodeIgniter">
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="true" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
@versedi
versedi / show-branches.sh
Last active April 19, 2016 06:27
Show branches for all subdirectories repos in current directory
#!/bin/bash
for D in *; do
if [ -d "${D}" ]; then
if [ -d "${D}/.git" ]; then
echo
echo --------------
echo
echo -e "\033[1m${D}\033[0m"
echo
@versedi
versedi / .bashrc
Last active April 19, 2016 11:54
bashrc.sh for cygwin
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
export PATH=$PATH:/cygdrive/d/xampp/php;
SSH_ENV=$HOME/.ssh/environment
# start the ssh-agent
function start_agent {
echo "Initializing new SSH agent..."
# spawn ssh-agent
@versedi
versedi / newsite.sh
Last active June 1, 2016 12:09
Shell script to automatically create new dev sites in Apache2, Usage: ./newsite mysite.dev /home/mysites/optional-full-path-to-site
#!/bin/bash
CYAN='\033[1;36m'
RED='\033[0;31m'
NC='\033[0m' # No Color
if [ `id -u` != 0 ]; then
echo -e "${RED}-- ERROR --${NC}"
echo -e "-- This script should be run as root so that files"
echo -e "-- can be created freely."
exit
#!/bin/bash
cd_func()
{
local x2 the_new_dir adir index
local -i cnt
if [[ $1 == "--" ]]; then
dirs -v
return 0
fi
@versedi
versedi / prototype-validation-classes.md
Last active August 2, 2016 07:21
prototype-validation-classes
Css Class Use Case / Error Message
validate-no-html-tags HTML tags are not allowed
validate-select Please select an option.
required-entry This is a required field.
validate-number Please enter a valid number in this field.
validate-number-range The value is not within the specified range.
validate-digits Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.
validate-digits-range The value is not within the specified range.
validate-alpha Please use letters only (a-z or A-Z) in this field.
@versedi
versedi / Magento-MySQL.sql
Last active September 18, 2016 18:17
Magento MySQL snippets
##Clean all Customer before going Live
SET FOREIGN_KEY_CHECKS=0;
-- reset customers
TRUNCATE customer_address_entity;
TRUNCATE customer_address_entity_datetime;
TRUNCATE customer_address_entity_decimal;
TRUNCATE customer_address_entity_int;
TRUNCATE customer_address_entity_text;