Skip to content

Instantly share code, notes, and snippets.

@chill117
chill117 / jquery.center.js
Last active December 17, 2015 12:19
Extend jQuery with the .center() method. Allows you to easily center element(s) within a container (or the viewport).
/*
|----------------------------------------------------------------
| Description
|----------------------------------------------------------------
Extend jQuery with the .center() method. Allows you to easily
center element(s) within a container (or the viewport).
@chill117
chill117 / cache_buster_helper.php
Created July 11, 2013 00:10
Force client browser to download fresh CSS/JS file whenever the file is modified on the server.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
|----------------------------------------------------------------
| Description
|----------------------------------------------------------------
Force client browser to download fresh CSS/JS file whenever
the file is modified on the server.
@chill117
chill117 / time_format_helper.php
Last active December 19, 2015 14:48
Quick, handy time format functions. Useful for GUIs or whenever a human-friendly time format is preferred over a timestamp or machine-readable date-time format.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
|----------------------------------------------------------------
| Description
|----------------------------------------------------------------
Quick, handy time format functions. Useful for GUIs or whenever
a human-friendly time format is preferred over a timestamp or
@chill117
chill117 / roman_numerals_helper.php
Created July 11, 2013 00:31
Converts an Arabic Numeral to Roman Numeral. Works for 1 through 4999.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
|----------------------------------------------------------------
| Description
|----------------------------------------------------------------
Converts an Arabic Numeral to Roman Numeral.
@chill117
chill117 / shell_helper.php
Created July 11, 2013 00:36
Provides the command_exists() method, which will test to see if the given shell command exists.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
|----------------------------------------------------------------
| Description
|----------------------------------------------------------------
Provides the command_exists() method, which will test to see if
the given shell command exists.
@chill117
chill117 / HostNameRouter.php
Last active April 20, 2024 14:10
Manage multiple hostnames (domains, sub-domains) within a single instance of CodeIgniter.
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
Manage multiple hostnames (domains, sub-domains) within a single instance of CodeIgniter.
Example:
If you had the following domain/sub-domain style for your site:
your-domain.com
@chill117
chill117 / ExtendHttpSupport.php
Last active December 20, 2015 23:38
Adds support for PUT verb in CodeIgniter; populates PHP's $_POST data super global with data for PUT requests.
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
Description:
Adds support for PUT verb in CodeIgniter; populates PHP's $_POST data
super global with data for PUT requests.
@chill117
chill117 / mysql_backup.sh
Last active December 13, 2021 22:02
Bash script to perform backups on one or more MySQL databases.
#!/bin/bash
#
# Use this script to perform backups of one or more MySQL databases.
#
# Databases that you wish to be backed up by this script. You can have any number of databases specified; encapsilate each database name in single quotes and separate each database name by a space.
#
# Example:
# databases=( '__DATABASE_1__' '__DATABASE_2__' )
@chill117
chill117 / prune_backups.sh
Created August 15, 2013 19:57
Automatically delete old backup files.
#!/bin/bash
#
# Use this script to automatically delete old backup files.
#
declare -i max_age
# Number of days to keep backup files.
max_age=10
@chill117
chill117 / start_stop_restart.sh
Created July 6, 2014 18:47
A simple bash script for starting/stopping/restarting an application or service.
#!/bin/bash
#
# A simple bash script for starting/stopping/restarting an application or service.
#
start()
{
# Your start application code goes here.
}