Skip to content

Instantly share code, notes, and snippets.

View scottcorgan's full-sized avatar
💭
Not coding

Scott Corgan scottcorgan

💭
Not coding
  • Tamarack
  • Shelbyville, KY
View GitHub Profile
@scottcorgan
scottcorgan / causes.php
Created December 21, 2011 16:23
Dynamic Causes
$campaigns = array();
$sql = "SELECT * FROM svn_posts WHERE post_type = 'shirts' AND post_date < now() ORDER BY ID DESC LIMIT 10";
$query = $this->db->query($sql);
// create organized arrays of campaign data
foreach($query->result() as $campaign){
$sql = 'SELECT * FROM svn_postmeta WHERE post_id = ' . $campaign->ID;
$results = $this->db->query($sql)->result();
$meta = array();
@scottcorgan
scottcorgan / scrolltop.js
Created December 22, 2011 22:53
Scrolltop
$(document).animate({
scrollTop : 100
});
function Sevenly(){
console.log('Do Good');
}
@scottcorgan
scottcorgan / gist:2771245
Created May 22, 2012 19:52
Highly Optimized Javascript Constructor
var Parent = (function() {
var Parent = {},
parentPrototype = {
func1: function(){}
};
Parent.create = function() {
var par = Object.create(parentPrototype);
return par
@scottcorgan
scottcorgan / gist:2913411
Created June 11, 2012 23:30
CSS Perspective
@cubic-ease: cubic-bezier(.26,.67,.27,1);
-webkit-transition:all 200ms @cubic-ease;
-webkit-transform: perspective( 600px ) rotateY( -70deg ) scale(0.75);
-moz-transition:all 200ms @cubic-ease;
-moz-transform: perspective( 600px ) rotateY( -70deg ) scale(0.75);
/* <i> Cloud */
html {
min-height: 100%;
background: linear-gradient(#b4bcbf, #fff);
}
.cloud {
display: inline-block;
background-color: #fff;
@scottcorgan
scottcorgan / product.html
Created June 21, 2012 16:05
Original Product
<div class='sizeChart'>
size info
</div>
<div class='slides'></div>
<div class='meta'>
<span class='price'>${{product.price}}</span>
<span class='desc'>
{{product.gender.spec.name}}
@scottcorgan
scottcorgan / avantlink_tracking.js
Created July 5, 2012 05:18
AvantLink Tracking
@scottcorgan
scottcorgan / _gaq_tracking.js
Created July 5, 2012 05:39
Google Analytics Ecommerce Tracking
//
// We add this once for each transaction
//
_gaq.push(['_addTrans',
'1234', // order ID - required
'Womens Apparel', // affiliation or store name
'28.28', // total - required
'1.29', // tax
'15.00', // shipping
@scottcorgan
scottcorgan / mongo_id.js
Created July 5, 2012 17:28
Pull date out of MongoDB ObjectID
var id = "4ff5cd62cb40c7010000000f";
var timehex = id.substring(0,8);
console.log(timehex);
var secondsSinceEpoch = parseInt(timehex, 16);
console.log(secondsSinceEpoch);
var dt = new Date(secondsSinceEpoch*1000);
console.log(dt);​