This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| Move Database Files (like MYD, MYI and frm) | |
|-------------------------------------------------------------------------- | |
| | |
| $config = array( | |
| 'tables' => array('table1','table2'), // array of tables / filenames to move | |
| 'extensions' => array('MYD','MYI','frm'), // required extensions for each database | |
| 'from' => dirname(__DIR__).'/transfer', // from location of files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Global Variables | |
$image_dir = "$_SERVER[DOCUMENT_ROOT]/examples/imgs"; // directory on server | |
$image_relative_path = '/examples/imgs'; // path to images relative to script | |
$file_types = array('jpg','jpeg','gif','png'); | |
$image_time = '4000'; // seconds each image will display (4000 = 4 seconds) | |
if($handle = opendir($image_dir)) { | |
while (false !== ($file = readdir($handle))) { | |
if ($file != "." && $file != "..") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var loading = false; | |
$(window).scroll(function(){ | |
if((($(window).scrollTop()+$(window).height())+250)>=$(document).height()){ | |
if(loading == false){ | |
loading = true; | |
$('#loadingbar').css("display","block"); | |
$.get("load.php?start="+$('#loaded_max').val(), function(loaded){ | |
$('body').append(loaded); | |
$('#loaded_max').val(parseInt($('#loaded_max').val())+50); | |
$('#loadingbar').css("display","none"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HTML: | |
// <h1 id="anchor">Lorem Ipsum</h1> | |
// <p><a href="#anchor" class="topLink">Back to Top</a></p> | |
$(document).ready(function() { | |
$("a.topLink").click(function() { | |
$("html, body").animate({ | |
scrollTop: $($(this).attr("href")).offset().top + "px" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function ordinal($cdnl){ | |
$test_c = abs($cdnl) % 10; | |
$ext = ((abs($cdnl) %100 < 21 && abs($cdnl) %100 > 4) ? 'th' | |
: (($test_c < 4) ? ($test_c < 3) ? ($test_c < 2) ? ($test_c < 1) | |
? 'th' : 'st' : 'nd' : 'rd' : 'th')); | |
return $cdnl.$ext; | |
} | |
for($i=1;$i<100;$i++){ | |
echo ordinal($i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function spreadAmount($amount,$qty) | |
{ | |
if($amount % $qty === 0) | |
{ | |
$start = $amount / $qty; | |
$last = $start; | |
} | |
else | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
spinner() | |
{ | |
local pid=$1 | |
local delay=0.4 | |
local spinstr='|/-\' | |
while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do | |
local temp=${spinstr#?} | |
printf " [%c] " "$spinstr" | |
local spinstr=$temp${spinstr%"$temp"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"order_num": "5066", | |
"customer_id": "1", | |
"po_num": null, | |
"email": "john@veldboom.com", | |
"phone": "", | |
"billing_name": "JOHN VELDBOOM", | |
"billing_addr1": "289 W MAIN ST", | |
"billing_addr2": "", | |
"billing_city": "NESS CITY", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "cjson" | |
local dt = require "date_time" | |
--[[ | |
From trink in IRC - thanks! | |
Example use: | |
[HttpListenInput] | |
address = "0.0.0.0:8325" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getMiddleRange(min,max,limit,type) | |
{ | |
--limit; | |
var new_num | |
var data = ''; | |
for(var x=0; x<=limit; x++) | |
{ | |
var new_num = Math.ceil((max - min) / limit); | |
new_num = min + (new_num * x); | |
if(x==0){new_num = min;} |