Skip to content

Instantly share code, notes, and snippets.

@stewartduffy
stewartduffy / index.html
Created December 2, 2012 21:15
A CodePen by Stewart Duffy.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Bad way...</title>
</head>
<body>
<div class='tall'>
<div class='short'>
Foo bar baz
</div>
/**
* Sample time
*/
background: #f06;
background: linear-gradient(90deg, #f06, yellow);
min-height: 100%;
font-family: Rockwell, "Courier Bold", Courier, Georgia, Times, "Times New Roman", serif;
@stewartduffy
stewartduffy / double_where_clause.php
Created May 14, 2013 09:19
PODS CMS pods double where clause
<?php
/*
Template Name: Month Page Template
*/
?>
<?php
$found_month = false;
global $pods;
$month_slug = pods_url_variable(-1);
@stewartduffy
stewartduffy / wp_upload_limit.php
Created May 14, 2013 09:26
Chuck this in your .htaccess file to Increase upload limit in wordpress with .htaccess file
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
@stewartduffy
stewartduffy / array_import.php
Created May 14, 2013 09:32
Import php array into PODS table, WordPress
<?php
$data = array(
"Performance Coaching",
"Principal Responsibilities of Leadership",
"Strategic Performance Template",
"Team Performance Compact",
"Team Performance One",
"Management Performance Compact",
"Management Performance One",
"Leadership Performance Compact",
function throttle( fn, time ) {
var t = 0;
return function() {
var args = arguments, ctx = this;
clearTimeout(t);
t = setTimeout( function() {
fn.apply( ctx, args );
}, time );
};
# Terminal Cheat Sheet
pwd # print working directory
ls # list files in directory
cd # change directory
~ # home directory
.. # up one directory
- # previous working directory
help # get help
-h # get help
/**
*
* Name v0.0.1
* Description, by Chris Ferdinandi.
* http://gomakethings.com
*
* Free to use under the MIT License.
* http://gomakethings.com/mit/
*
*/
@stewartduffy
stewartduffy / gist:481f21ea4906e611d934
Last active August 10, 2022 03:03
Regex to remove file extension from JS string.
var filenameFull = "tm_icons.png";
//Regex to remove
var filenameText = filenameFull.replace(/\.[^/.]+$/, "");
@stewartduffy
stewartduffy / gist:f6b774deeb8ed735db29
Created February 26, 2015 21:32
JS function to get file name (without path or file extention)
var fileName = function(filePath) {
var filename = filePath.split("/");
return filename[filename.length - 1].replace(/\.[^/.]+$/, "");
};
var filePath = "/downloads/tm/logos/IMG_30012014_185815.png";
console.log( fileName(filePath) );