Skip to content

Instantly share code, notes, and snippets.

View jaidetree's full-sized avatar

jaide (formerly eccentric-j) jaidetree

View GitHub Profile
@jaidetree
jaidetree / gist:1145283
Created August 14, 2011 20:40
undefined method `products' for class `News'
class News < ActiveRecord::Base
alias_method :products_original, :products
serialize :products
belongs_to :user
def products
self.products_original
end
<?php
class DivesBox extends MetaBox
{
var $name = 'dive-info';
var $label = "Dive Info";
var $post_types = 'akz-dive';
var $position = 'normal';
var $fields = array(
array(
import sys
exit()
@jaidetree
jaidetree / kdBarycentricsV0.1.mel
Created May 31, 2012 01:15 — forked from korydondzila/gist:2839802
Kory Dondzila's Scripts
//////////////////////////////////////////////////////////////////////////
/// ///
/// SCRIPT: kdAutoRigV0.1.mel - MEL Script ///
/// ///
/// AUTHOR: Kory Dondzila - kory@korydondzila.com ///
/// www.korydondzila.com ///
/// ///
/// DESCRIPTION: This is a prototype script. It allows the ///
/// user to rig the spine and neck of a character. ///
/// The script generates the locators for the user ///
<header id="header">
<div class="logo">
<a href="#">
<img src="" alt="" />
</a>
</div>
<nav>
<ul>
<li></li>
</ul>
@jaidetree
jaidetree / gist:5670693
Last active December 17, 2015 20:49 — forked from anonymous/gist:5670671
if (root.loaderInfo.parameters.clickTAG.substr(0,5) == "http:") {
// Add more button instances here
ClickHotspot.addEventListener( MouseEvent.CLICK, clickTagHandler);
// If within a movie clip
// movieClipInstanceName.buttonInstanceName.addEventListener(MouseEvent.CLICK, clickTagHandler);
}
function clickTagHandler(e:MouseEvent):void {
navigateToURL(new URLRequest(root.loaderInfo.parameters.clickTAG), "_blank");
@jaidetree
jaidetree / gist:5670793
Last active December 17, 2015 20:49 — forked from anonymous/gist:5670763
var clickTagURL:String = "";
if (root.loaderInfo.parameters.hasOwnProperty("clickTAG")) {
clickTagURL = root.loaderInfo.parameters['clickTAG'];
}
if ((/^http\:\/\/.*/).test(clickTagURL)) {
setClickTagHandlers();
}
/* =LinkBox Widget Styles
-------------------------------------------------------------- */
.widget.widget_link_box {
margin: 0;
}
.widget.widget_link_box p {
margin: 0;
}
.widget.widget_link_box a,
.widget.widget_link_box a:visited {
@jaidetree
jaidetree / main.c
Last active December 28, 2015 04:49
Divides a sensorValue by 48 and displays it in the console.
#include <stdio.h>
float calcSensorValue(int originalValue) {
// Casting allows us to take an integer and treat it as a float,
// which means getting decimal numbers instead of whole numbers
// which would be inaccurate.
return 48 / (float)originalValue;
}
// Responsible for handling output.
<!DOCTYPE html>
<!--[if IE 6]>
<html id="ie6" dir="ltr" lang="en-EN">
<![endif]-->
<!--[if IE 7]>
<html id="ie7" dir="ltr" lang="en-EN">
<![endif]-->
<!--[if IE 8]>
<html id="ie8" dir="ltr" lang="en-EN">
<![endif]-->