Skip to content

Instantly share code, notes, and snippets.

View INDIAN2020's full-sized avatar

Gogula Sivannarayana INDIAN2020

View GitHub Profile
<?php
/*wordpress comment spammer*/
function in_comment_post_like($string, $array) {
foreach($array as $ref) { if(strstr($string, $ref)) { return true; } }
return false;
}
function drop_bad_comments() {
if (!empty($_POST['comment'])) {
$post_comment_content = $_POST['comment'];
$lower_case_comment = strtolower($_POST['comment']);
@INDIAN2020
INDIAN2020 / gist:6076934
Created July 25, 2013 04:36
font stack
/* Times New Roman-based stack */
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
/* Modern Georgia-based serif stack */
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif;
/* Traditional Garamond-based serif stack */
font-family: "Palatino Linotype", Palatino, Palladio, "URW Palladio L", "Book Antiqua", Baskerville, "Bookman Old Style", "Bitstream Charter", "Nimbus Roman No9 L", Garamond, "Apple Garamond", "ITC Garamond Narrow", "New Century Schoolbook", "Century Schoolbook", "Century Schoolbook L", Georgia, serif;
/* Helvetica/Arial-based sans serif stack */
@INDIAN2020
INDIAN2020 / gist:6079030
Created July 25, 2013 12:07
columns shortcode
function wptuts_columns_sc( $atts, $content = null, $tag ) {
extract( shortcode_atts( array(
// extra classes
'class' => ''
), $atts ) );
if ( $class != '' )
$class = ' ' . $class;
$last = '';
// check the shortcode tag to add a "last" class
if ( strpos( $tag, '_last' ) !== false )
@INDIAN2020
INDIAN2020 / gist:6094561
Created July 27, 2013 10:58
plugin head
/*
* Plugin Name: ${1: name}
* Plugin URI: ${1: name}
* Description: ${1: name}
* Version: ${1: name}
* Author: ${1: name}
* Author URI: ${1: name}
* License: GPL2
Copyright ${1: neme} Paul Underwood
<?php
//Google Docs Viewer
function pdflink($attr, $content) {
if ($attr['href']) {
return '<a class="pdf" href="http://docs.google.com/viewer?url=' . $attr['href'] . '">'.$content.'</a>';
} else {
$src = str_replace("=", "", $attr[0]);
return '<a class="pdf" href="http://docs.google.com/viewer?url=' . $src . '">'.$content.'</a>';
}
@INDIAN2020
INDIAN2020 / gist:6153866
Created August 5, 2013 06:30
php: functions for me
<?php
// 1
function hex2rgb( $colour ) {
if ( $colour[0] == '#' ) {
$colour = substr( $colour, 1 );
}
if ( strlen( $colour ) == 6 ) {
list( $r, $g, $b ) = array( $colour[0] . $colour[1], $colour[2] . $colour[3], $colour[4] . $colour[5] );
} elseif ( strlen( $colour ) == 3 ) {
list( $r, $g, $b ) = array( $colour[0] . $colour[0], $colour[1] . $colour[1], $colour[2] . $colour[2] );
.text-shadow {
text-shadow: 2px 2px 4px #666;
}
.box-shadow{
box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
-moz-box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
-webkit-box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
}
.round{
-moz-border-radius: 10px;
#content .entry-content .ngg-albumoverview{
display:inline;
float:left
}
.ngg-albumoverview{}
.ngg-album-compact{}
.ngg-album-compactbox{}
http://snippets.webaware.com.au/howto/creating-a-custom-gallery-template-for-nextgen-gallery/
function wptuts_columns_sc( $atts, $content = null, $tag ) {
extract( shortcode_atts( array(
// extra classes
'class' => ''
), $atts ) );
if ( $class != '' )
$class = ' ' . $class;
$last = '';
// check the shortcode tag to add a "last" class
if ( strpos( $tag, '_last' ) !== false )
http://www.youtube.com/user/iPriceProductions?feature=watch
http://www.worldofwebcraft.com/topic.php?id=5160
http://net.tutsplus.com/articles/general/9-ways-to-instantly-code-faster/
http://www.worldofwebcraft.com/topic.php?id=5160