Skip to content

Instantly share code, notes, and snippets.

View WordpressDev's full-sized avatar

Rafique WordpressDev

  • Fornace S.r.l
  • Dhaka
View GitHub Profile
@WordpressDev
WordpressDev / gist:3978713
Created October 30, 2012 07:02 — forked from jameshartig/gist:772316
Google Voice Message Counter
/*
This is assuming you don't delete text messages. This only counts the amount of text messages you have not deleted.
This may take 5 minutes or so, depending on your computer speed and how many text messages you have.
Instructions:
Visit: https://www.google.com/voice/b/0#sms/ and wait for the page to fully load.
Paste this into your Javavscript console, wait it stops and look at the last count.
@WordpressDev
WordpressDev / codeigniter_htaccess
Created October 30, 2012 07:10 — forked from muhittin/codeigniter_htaccess
Codeigniter htaccess
RewriteEngine On
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php/$1
@WordpressDev
WordpressDev / .htaccess_codeigniter
Created October 30, 2012 07:11 — forked from ssheduardo/.htaccess_codeigniter
htaccess codeigniter
RewriteEngine on
RewriteCond $1 !^(img|index.php|js|robots.txt|css)
RewriteRule ^(.*)$ index.php/$1 [L]
@WordpressDev
WordpressDev / gist:3978746
Created October 30, 2012 07:11
codeigniter / cloudflare
class MY_Input extends CI_Input
{
function ip_address()
{
$ip = parent::ip_address();
$proxy = $this->get_request_header('X-Forwarded-For');
if($proxy) // check if there is a proxy being used
{
$iplong = ip2long($ip);
@WordpressDev
WordpressDev / foundation-menu.php
Created December 7, 2012 16:07 — forked from reinislejnieks/foundation-menu.php
WordPress walker for ZURB's Foundation Nav Bar classes
add_theme_support( 'menus' );
/*
http://codex.wordpress.org/Function_Reference/register_nav_menus#Examples
*/
register_nav_menus( array(
'main-menu' => 'Main Menu' // registers the menu in the WordPress admin menu editor
) );
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
<?php
/*
Here's a couple of metaboxes that I've recently created using this system
*/
$subpostings = redrokk_metabox_class::getInstance('subpostings', array(
'title' => '(optional) Subscription for Postings',
'description' => "As an optional feature, you have a complete api at your disposal which will allow you the ability to offer and manage member posts. In addition to these settings, you may need to create the associated pages for accepting posts from your frontend.",
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
<?php
add_theme_support('menus');
/*
http://codex.wordpress.org/Function_Reference/register_nav_menus#Examples
*/
register_nav_menus(array(
'top-bar-l' => 'Left Top Bar', // registers the menu in the WordPress admin menu editor
'top-bar-r' => 'Right Top Bar'
));
<?php
class Asset_Instance extends Fuel\Core\Asset_Instance {}
class Cache_Handler_Json extends Fuel\Core\Cache_Handler_Json {}
class Cache_Handler_Serialized extends Fuel\Core\Cache_Handler_Serialized {}
class Cache_Handler_String extends Fuel\Core\Cache_Handler_String {}
class Cache_Storage_Apc extends Fuel\Core\Cache_Storage_Apc {}
abstract class Cache_Storage_Driver extends Fuel\Core\Cache_Storage_Driver {}
class Cache_Storage_File extends Fuel\Core\Cache_Storage_File {}
class Cache_Storage_Memcached extends Fuel\Core\Cache_Storage_Memcached {}