Skip to content

Instantly share code, notes, and snippets.

@ngfw
ngfw / cleaner.sh
Last active December 26, 2015 20:29
Clear cache files with cron
#!/bin/bash
# Params
# Remove Files Every N Min
MINUTESTOKEEPFILES=2880
# DO NOT EDIT BELOW THIS LINE
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do
@ngfw
ngfw / gist:4684951
Created January 31, 2013 18:15
PHP Base62 Class
<?php
/**
* Base62: A class to convert a number from any base between 2-62 to any other base between 2-62
* It doesn't use BC Math functions so works without the use of BC Math library.
* It uses the native base_convert functions when the base is below 36 for faster execution.
* The output number is backward compatible with the native base_convert function.
*
* Author : Lalit Patel
* Website: http://www.lalit.org/lab/base62-php-convert-number-to-base-62-for-short-urls
* License: Apache License 2.0
#!/usr/bin/php
<?php
$usage = "Automated Wordpress installer\nby Ali Gangji\nUsage: wordpress install_dir -u dbuser -p dbpass -d dbname\nOptions:\n";
$usage .= " -u dbuser Database username\n";
$usage .= " -p dbpass Database password\n";
$usage .= " -d dbname Database name\n";
$usage .= " -h dbhost Database host\n";
$usage .= " --private Hide blog from search engines\n";
$usage .= " --prefix prefix Database prefix\n";
if ($argc < 2) {