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
class Loader | |
{ | |
public function __construct() | |
{ | |
spl_autoload_register(array($this , 'load')); | |
} | |
private function __clone() {} | |
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
# This builds on the YAML Interface so I need to require it here. | |
require 'yaml'; | |
# This is my YAML helper it is meant to wrap a YML file and allow you to access | |
# it has if it was a class, giving you access to the data contained in the hash | |
# in a OOP way. Still needs a little work especially with the casscade. | |
module DMH_Yaml_Helper | |
# This holds the configuration hash file | |
@hash | |
# Holds the filename for the config file this is if you need to save later | |
@filename |
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
/** | |
* Options | |
* ======= | |
* Required | |
* -------- | |
* element : a protoype element / or an DOM Id [Required] | |
* from : The date to go from can ether be a string or a offest (see below about offests and date string) | |
* to : The date to go to can ether be string of a offset (see below about offests and date string) | |
* | |
* Optional |
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 'mysql2' | |
client = Mysql2::Client.new(:host => "127.0.0.1", :username => "root" , :password => "root") | |
results = client.query("show Databases;") | |
puts "found #{results.count} databases \n" | |
results.each do | row | | |
puts row["Database"] |
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($){ | |
$.fn.placement = function() { | |
var defaults = {}; | |
this.each(function(){ | |
var el = $(this); | |
var current_id = el.attr('id'); | |
defaults[current_id] = el.val(); |
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
/* | |
jQuery Simple Element Factory Plugin | |
==================================== | |
Version 1. By DotMH http://github.com/dotmh | |
This simply creates a html element , extended in jquery so all jquery's | |
functionality is there. | |
@param tag <string> : The tag you want to create , ie div (no < or > ) | |
@param options <object> : an object containing attribute name: value. |
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
// usage: log('inside coolFunc', this, arguments); | |
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ | |
window.log = function(){ | |
log.history = log.history || []; // store logs to an array for reference | |
log.history.push(arguments); | |
if(this.console) { | |
arguments.callee = arguments.callee.caller; | |
var newarr = [].slice.call(arguments); | |
(typeof console.log === 'object' ? log.apply.call(console.log, console, newarr) : console.log.apply(console, newarr)); | |
} |
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($){ | |
var IONPANE_ORIENTATIONS_HORZ = 1, | |
IONPANE_ORIENTATIONS_VERT = 2, | |
IONPANE_USE_CONTAINER = 'container', | |
IONPANE_USE_DOCUMENT = 'document'; | |
$.widget('ion.panes' , { | |
version : '0.0.0', | |
options : { | |
orientation : IONPANE_ORIENTATIONS_VERT, |
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
#!/usr/bin/env ruby | |
require 'sinatra' | |
PUBLIC_FOLDER = File.join(File.dirname(__FILE__) , 'site') | |
set :public_folder , PUBLIC_FOLDER | |
set :static , true | |
get '/' do | |
File.open(File.join(PUBLIC_FOLDER , 'index.html') , 'r').read.to_s |
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($){ | |
$.fn.popdown = function( trigger_at ) { | |
var element = this; | |
var trigger = trigger_at; | |
$(document).scroll(function(e){ | |
var spos = $(document).scrollTop(); | |
if (spos >= trigger) { |
OlderNewer