Skip to content

Instantly share code, notes, and snippets.

View rakeshtembhurne's full-sized avatar
😉
Writing a Book

Rakesh Tembhurne rakeshtembhurne

😉
Writing a Book
View GitHub Profile
@rakeshtembhurne
rakeshtembhurne / functions.php
Created March 3, 2012 10:59
Code int the file adds a wide header with blog name and description for Child Theme of Roots theme for WordPress
<?
// hooks this function with parent theme' (Roots) action that can be used to display content below navbar
add_action('roots_content_before', 'roots_get_content_before');
/**
* Displays blog title and description
*
* @return void;
*/
function roots_get_content_before() {
@rakeshtembhurne
rakeshtembhurne / build.xml
Created August 8, 2012 11:57
Ant build.xml file for Sahi & Jenkins
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="bids" default="runfftests">
<property environment="env"/>
<property name="sahi.home" value="${env.SAHI_HOME}" location="/home/rakesh/sahi/" />
<property name="user.data" value="${env.SAHI_USERDATA_DIR}" location="/home/rakesh/sahi/userdata" />
<property name="urlbase" value="http://shdlr.local/"/>
<taskdef name="sahi" classname="net.sf.sahi.ant.RunSahiTask" classpath="${sahi.home}/lib/ant-sahi.jar"/>
<target name="runfftests">
<antcall target="startsahi"/>
@rakeshtembhurne
rakeshtembhurne / ajax file load
Created September 20, 2012 09:03
Ajax file load
// HTML
<div id="ajaxBusy"></div>
// CSS
#ajaxBusy {
display:none;
position: fixed;
@rakeshtembhurne
rakeshtembhurne / bootstrap-popover-extra-placements.js
Created September 27, 2012 04:33
JavaScript: Bootstrap Popover placement option to make auto change placement direction
var timeOutObj;
$(function(){
$(".card-btn").popover({
trigger: "manual",
html : true,
placement: function(tip, element) {
var $element, above, actualHeight, actualWidth, below, boundBottom, boundLeft, boundRight, boundTop, elementAbove, elementBelow, elementLeft, elementRight, isWithinBounds, left, pos, right;
isWithinBounds = function(elementPosition) {
return boundTop < elementPosition.top && boundLeft < elementPosition.left && boundRight > (elementPosition.left + actualWidth) && boundBottom > (elementPosition.top + actualHeight);
};
@rakeshtembhurne
rakeshtembhurne / bootstrap-popover-placement-extra-v2.0.3.css
Created September 27, 2012 12:38
CSS: Twitter Bootstrap Popover extra placements for v2.0.3
.popover.top-left, .popover.top-right {
margin-top: -5px;
}
.popover.bottom-left, .popover.bottom-right {
margin-top: 5px;
}
.popover.top-left .arrow {
bottom: 0;
left: 20%;
@rakeshtembhurne
rakeshtembhurne / .gitignore
Created October 2, 2012 05:53
CakePHP: default .gitignore file
# Test URI
# Ignore netbeans folder
nbproject/*
# Ignore private folder
/app/private/*
!/app/private/empty
# Ignore packed asset files
/app/webroot/css/packed/*
@rakeshtembhurne
rakeshtembhurne / php import
Created October 3, 2012 07:50
php import
/**
* Action method used to import talks
*
* @return void
*/
public function import()
{
// Build and initialize needed variables
$csv = $this->request->data['Talk']['csv'];
$error = null;
@rakeshtembhurne
rakeshtembhurne / .htaccess
Last active December 24, 2015 11:27
CakePHP: .htaccess file to run wordpress from webroot/blog directory
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/blog.*
RewriteCond %{REQUEST_URI} !-f
RewriteRule ^$ app/webroot/ [L]
RewriteCond %{REQUEST_URI} !^/blog.*
RewriteCond %{REQUEST_URI} !-d
RewriteRule (.*) app/webroot/$1 [L]
@rakeshtembhurne
rakeshtembhurne / .gitignore
Created October 10, 2012 12:58
another cakephp htaccess
# CakePHP
/app/tmp/*
/app/Config/database.php
/app/Config/core.php
!empty
/plugins
/vendors
/app/webroot/coverage/*
/tmp/*
/app/Plugin/*
@rakeshtembhurne
rakeshtembhurne / build.xml
Created October 10, 2012 12:59
another buildxml file
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by PHP Project Wizard (PPW) 1.0.4 on Mon Jul 30 14:22:42 IST 2012 -->
<project name="hourli2" default="build" basedir=".">
<property name="source" value="app"/>
<target name="clean" description="Clean up and create artifact directories">
<delete dir="${basedir}/build/api"/>
<delete dir="${basedir}/build/code-browser"/>
<delete dir="${basedir}/build/coverage"/>