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
### Download setup Ubuntu 14.04 box | |
``` | |
// from local directory | |
vagrant init chef/ubuntu-14.04 | |
``` | |
### Setup Vagrantfile | |
``` | |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : |
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 | |
class onixSplitter | |
{ | |
function split($file,$header,$footer,$split_at=2000) | |
{ | |
$this->file = $file; | |
$this->header = $header; | |
$this->footer = $footer; | |
$this->split_at = $split_at; | |
$this->write_num = 1; // starting number for files written |
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
ANT000000 | Antiques & Collectibles / General | |
---|---|---|
ANT001000 | Antiques & Collectibles / Americana | |
ANT002000 | Antiques & Collectibles / Art | |
ANT003000 | Antiques & Collectibles / Autographs | |
ANT005000 | Antiques & Collectibles / Books | |
ANT006000 | Antiques & Collectibles / Bottles | |
ANT007000 | Antiques & Collectibles / Buttons & Pins | |
ANT008000 | Antiques & Collectibles / Care & Restoration | |
ANT009000 | Antiques & Collectibles / Transportation | |
ANT010000 | Antiques & Collectibles / Clocks & Watches |
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 | |
require_once app_path().'/libraries/google-api-php-client/src/Google_Client.php'; | |
require_once app_path().'/libraries/google-api-php-client/src/contrib/Google_AnalyticsService.php'; | |
session_start(); | |
$client = new Google_Client(); | |
$client->setApplicationName("Google Analytics PHP Starter Application"); | |
// Visit https://code.google.com/apis/console?api=analytics to generate your |
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
DROP TABLE IF EXISTS `onix_code_list`; | |
CREATE TABLE `onix_code_list` ( | |
`list_id` int(11) unsigned NOT NULL, | |
`values` varchar(20) DEFAULT NULL, | |
`name` varchar(100) DEFAULT '', | |
`notes` text, | |
`revision` int(11) unsigned DEFAULT NULL, | |
KEY `list_id` (`list_id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
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" |