Skip to content

Instantly share code, notes, and snippets.

@Bon2xl
Bon2xl / Loading-Pot.markdown
Created December 18, 2013 11:21
A Pen by Arvind.
@Bon2xl
Bon2xl / embed-view.php
Last active August 29, 2015 14:20
Drupal Templating
// Embed Views
<?php print views_embed_view('pcns', 'block_1'); ?>
@Bon2xl
Bon2xl / arvind-zsh-theme.sh
Last active August 29, 2015 23:33
My zsh theme arvind.zsh-theme
# prompt style and colors based on Steve Losh's Prose theme:
# http://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme
#
# vcs_info modifications from Bart Trojanowski's zsh prompt:
# http://www.jukie.net/bart/blog/pimping-out-zsh-prompt
#
# git untracked files modification from Brian Carper:
# http://briancarper.net/blog/570/git-info-in-your-zsh-prompt
export VIRTUAL_ENV_DISABLE_PROMPT=1
@Bon2xl
Bon2xl / backupdb.sh
Created September 23, 2015 14:48
backup MAMP DB
####################################
# BACKUP MAMP DATABASE
####################################
function backupDATA(){
TIMESTAMP=$(date +"%F-%H-%M-%S")
BACKUP_DIR="/Users/arvind/Dropbox/HybridForge/DB"
MYSQL_USER="root"
MYSQL=/Applications/MAMP/Library/bin/mysql
MYSQL_PASSWORD="root"
MYSQLDUMP=/Applications/MAMP/Library/bin/mysqldump
@Bon2xl
Bon2xl / git-un-change-syntax.bash
Created February 25, 2016 15:01
Git Assume Un-Change
git update-index --no-assume-unchanged <file>
@Bon2xl
Bon2xl / truncateText.js
Last active March 18, 2016 19:39
Truncate text in jQuery. Contexts string into array by using space as separator, then converts to string and replace comma into space.
var txt;
txt = $(".teaser-txt").text().split(" ", 9).toString();
txt = txt.replace (/,/g, " ");
@Bon2xl
Bon2xl / index.ios.js
Created April 14, 2016 18:16
Listview with Section Header and Row
import React, {
AppRegistry,
Component,
StyleSheet,
ListView,
Text,
View
} from 'react-native';
@Bon2xl
Bon2xl / .gitignore
Last active April 15, 2016 16:59
drupal git ignore
# Ignore configuration files that may contain sensitive information.
# Allow settings.php to enable Domain Access module
sites/*/settings.local.php
# Ignore paths that contain user-generated content.
/sites/*/files
/sites/*/private
/files/*
/cache
@Bon2xl
Bon2xl / mapsInfoWindows.js
Created September 28, 2016 00:43
Google Maps multiple info windows
var center = new google.maps.LatLng(53.5557957,-113.6340293);
var options = {
'zoom': 9,
'center': center,
'mapTypeId': google.maps.MapTypeId.ROADMAP,
'disableDoubleClickZoom': false,
};
var map = new google.maps.Map(document.getElementById("map"), options);
var markers = [];
}
@Bon2xl
Bon2xl / getthemename.php
Last active April 26, 2017 22:08
Drupal: get current theme
$custom_theme = variable_get('theme_default');
dpm($custom_theme);