Skip to content

Instantly share code, notes, and snippets.

View CrowderSoup's full-sized avatar
🦄
[object Object]

Aaron Crowder CrowderSoup

🦄
[object Object]
View GitHub Profile
@CrowderSoup
CrowderSoup / footerExtend.js
Created May 20, 2014 22:58
Extend footer to take up the remainder of the viewport
var viewportHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
var footerDistanceFromTop = $('.footer').offset().top;
if (footerDistanceFromTop < viewportHeight) {
var footerHeight = viewportHeight - footerDistanceFromTop;
var footerMinHeight = parseInt($('.footer').css('min-height').split('px')[0]);
if (footerHeight > footerMinHeight) {
$('.footer').css('height', footerHeight + 'px');
}
@CrowderSoup
CrowderSoup / imgresizr.py
Last active August 29, 2015 14:11
Just a quick example of how to resize an INCREDIBLY large image.
from PIL import Image
# 8 Inches
basewidth = 768
# This is the size of the image I was working with... this line will supress warnings about the image being too big
Image.MAX_IMAGE_PIXELS = 556631040
# Open the image
img = Image.open("original.png")
@CrowderSoup
CrowderSoup / keybase.md
Last active August 29, 2015 14:16
keybase.md

Keybase proof

I hereby claim:

  • I am CrowderSoup on github.
  • I am crowdersoup (https://keybase.io/crowdersoup) on keybase.
  • I have a public key whose fingerprint is CF37 B14A 2FB4 F73B FFD5 8C01 680E C0CD 3F2D 62A0

To claim this, I am signing this object:

@CrowderSoup
CrowderSoup / 3colgrid.css
Created June 25, 2012 17:55
Basic 3-col CSS Grid
/**
* This is the most simple 3-col CSS grid I could imagine. It supports 3 columns of equal size with 10px margins. Feel free to modify this as
* you need.
*/
/**
* The row
*/
.row { clear: both; overflow: hidden; margin: 0 0 10px 0; }
@CrowderSoup
CrowderSoup / random.php
Created August 9, 2012 20:55
PHP Random String Generator
<?php
function get_rand_str($length)
{
$chars = array_merge(range('a','z'), range('A','Z'), array('!','@','#','$','%','&','*'));
$length = intval($length) > 0 ? intval($length) : 16;
$max = count($chars) - 1;
$str = "";
while($length--) {
shuffle($chars);
@CrowderSoup
CrowderSoup / PrintArray.php
Created October 26, 2012 02:49
Better var_dump for Arrays
function PrintArray($aVals)
{
echo "<ul>";
foreach($aVals as $key => $val)
{
if(is_array($val))
{
echo "<li><strong>{$key}</strong>";
PrintArray($val);
echo "</li>";
@CrowderSoup
CrowderSoup / app.js
Created November 3, 2012 17:23
Clear a Form with jQuery
function cancelForm(formName) {
$("#" + formName)[0].reset();
}
@CrowderSoup
CrowderSoup / index.php
Created November 28, 2012 20:38
PHP array_map() example
<?php
$stuff = array('Bean', 'Apple', 'Tree');
$stuff = array_map('strtolower', $stuff);
var_dump($stuff);
?>
@CrowderSoup
CrowderSoup / minify.php
Created December 7, 2012 19:32
Css Minification on the Fly
<?php
require_once('../includes/utils.php');
/**
* minify
*
* Class that handles the minification of all required CSS files
*/
class minify
@CrowderSoup
CrowderSoup / hourOfCode.js
Created December 9, 2015 07:29
Hour Of Code Star Wars Game
var game = function () {
setBackground("random");
setMap("random");
setDroid("R2-D2");
setDroidSpeed("normal");
playSound("R2-D2random");
var moved = false;
var points = 0;