Skip to content

Instantly share code, notes, and snippets.

View drewjoh's full-sized avatar

Drew Johnston drewjoh

View GitHub Profile
# CodeIgniter writing
RewriteCond $1 !^(index\.php|images|robots\.txt|css|user_files|subdomain1|subdomain2)
RewriteRule ^(.*)$ /index.php/$1 [L]
<?php
$file = @fopen($filename,"r");
if ($file)
{
while(!feof($file))
{
print(fread($file, 1024*4));
flush();
1f8fec61-4a6f-9bd5-7f8e-e12325c464c3
1f8fed49-4a6f-9bd5-7f8e-d665dedc0297
1f8fee17-4a6f-9bd5-7f8e-29d1ce3e9e30
1f8feef2-4a6f-9bd5-7f8e-8ce03bebdbdf
1f8fefc7-4a6f-9bd5-7f8e-c22fbedb5390
<style type="text/css">
.btn {
border-radius:4px;
-moz-border-radius:4px;
-webkit-border-radius:4px;
background:url("./btn_bg.png") repeat-x scroll 0 2px #efefef;
border-color:#5b5b5b;
border-style:solid;
border-width:1px;
color:#262626;
<?php
/**
* Remove any non-ASCII characters and convert known non-ASCII characters
* to their ASCII equivalents, if possible.
*
* @param string $string
* @return string $string
* @author Jay Williams <myd3.com>
* @license MIT License
* @link http://gist.github.com/119517
@drewjoh
drewjoh / ticks_to_timestamp.php
Created September 26, 2010 00:53
Ticks to Timestamp Function
<?php
/*
* Ticks To Unix Timestamp
*
* Function to get a usable timestamp from ticks
* Returns a unix timestamp or MySQL datetime
*
* $ticks - the tick (timestamp) that we're converting to a unix timestamp
* $offset - the time offset in hours to adjust the result to
@drewjoh
drewjoh / timezones.min.php
Created October 11, 2011 03:59
List of all timezones compatible with the PHP DateTimeZone object.
$timezones = array('UTC','Africa/Abidjan','Africa/Accra','Africa/Addis_Ababa','Africa/Algiers','Africa/Asmara','Africa/Asmera','Africa/Bamako','Africa/Bangui','Africa/Banjul','Africa/Bissau','Africa/Blantyre','Africa/Brazzaville','Africa/Bujumbura','Africa/Cairo','Africa/Casablanca','Africa/Ceuta','Africa/Conakry','Africa/Dakar','Africa/Dar_es_Salaam','Africa/Djibouti','Africa/Douala','Africa/El_Aaiun','Africa/Freetown','Africa/Gaborone','Africa/Harare','Africa/Johannesburg','Africa/Juba','Africa/Kampala','Africa/Khartoum','Africa/Kigali','Africa/Kinshasa','Africa/Lagos','Africa/Libreville','Africa/Lome','Africa/Luanda','Africa/Lubumbashi','Africa/Lusaka','Africa/Malabo','Africa/Maputo','Africa/Maseru','Africa/Mbabane','Africa/Mogadishu','Africa/Monrovia','Africa/Nairobi','Africa/Ndjamena','Africa/Niamey','Africa/Nouakchott','Africa/Ouagadougou','Africa/Porto-Novo','Africa/Sao_Tome','Africa/Timbuktu','Africa/Tripoli','Africa/Tunis','Africa/Windhoek','America/Adak','America/Anchorage','America/Anguilla','Ameri
@drewjoh
drewjoh / bootstrap.custom.css
Created September 15, 2012 20:10
CSS to make Laravel 3.2's built in pagination links work with Bootstrap 2.1.
.pagination a, .current, .previous_page, .next_page
{
float: left;
padding: 0 14px;
line-height: 34px;
text-decoration: none;
border: 1px solid #ddd;
border-left-width: 0;
}
@drewjoh
drewjoh / ocp.php
Created June 20, 2013 16:57 — forked from ck-on/ocp.php
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.6
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
0.1.5 2013-04-12 added graphs to visualize cache state, please report any browser/style bugs
@drewjoh
drewjoh / drewjoh.zsh-theme
Created March 24, 2016 14:58
OhMyZsh Custom Theme
#
# Forked from https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
#
# In addition, I recommend the