Skip to content

Instantly share code, notes, and snippets.

View HoundstoothSTL's full-sized avatar

Rob Bennet HoundstoothSTL

View GitHub Profile
@HoundstoothSTL
HoundstoothSTL / input-clear.js
Created November 15, 2012 20:01
jQuery Input Clearing
// Input Clearing
$.fn.cleardefault = function() {
return this.focus(function() {
if( this.value == this.defaultValue ) {
this.value = '';
}
}).blur(function() {
if( !this.value.length ) {
this.value = this.defaultValue;
@HoundstoothSTL
HoundstoothSTL / wp-download.sh
Created November 15, 2012 20:10
Download Wordpress through terminal and cleanup
#!/bin/bash
#Download the latest copy of WordPress into a directory, grab all the files in the new /wordpress folder
#Put all the files in the current directory, remove the now empty /wordpress directory
#Remove the tarball
#download latest wordpress with wget
wget http://wordpress.org/latest.tar.gz
#OR using CURL
@HoundstoothSTL
HoundstoothSTL / NamedMixins
Created November 19, 2012 18:29
Sass Responsive Named Mixins
// Variables defined in _variables.scss
// Usage @include breakpoint(medium) { width: XXX }
@mixin breakpoint($point) {
@if $point == massive {
@media (min-width: $massiveViewportWidth) { @content; }
}
@else if $point == xxl {
@media (min-width: $xxlargeViewportWidth) { @content; }
}
@HoundstoothSTL
HoundstoothSTL / default.vcl
Created November 21, 2012 21:45
Varnish vcl file
## Varnish to sit on top of Nginx web server
## App running on WordPress with W3 Total Cache plugin running
backend default {
.host = "localhost";
.port = "8080";
}
acl purge {
"localhost";
}
@HoundstoothSTL
HoundstoothSTL / latest-tweets.js
Created November 28, 2012 21:02
JavaScript: Search Latest Tweets
// Declare variables to hold twitter API url and user name
var twitter_api_url = 'http://search.twitter.com/search.json';
var keyword = 'iphone5';
var tweet_limit = 3;
// Enable caching
$.ajaxSetup({ cache: true });
/* The returned JSON object will have a property called "results" where we find
* a list of the tweets matching our request query
@HoundstoothSTL
HoundstoothSTL / wp-config.php
Last active December 10, 2015 17:08
WordPress configuration setup for multiple server environments.
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
@HoundstoothSTL
HoundstoothSTL / db-error.php
Created January 6, 2013 04:30
DB Error Page for WordPress
<?php
$mailto = "Houndstooth Administrator <[email protected]>";
$mailfrom = "[email protected]";
if ($_SERVER['REQUEST_URI'] != "/wp-content/db-error.php") {
$headers = "From: " . $mailfrom;
$message = "Something broke here: http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
$subject = "DB error at ".$_SERVER['SERVER_NAME'];
mail($mailto,$subject,$message,$headers);
@HoundstoothSTL
HoundstoothSTL / Gruntfile.js
Last active December 11, 2015 02:59
Bolt Gruntfile - From the Bolt WordPress theme
/*global module:false*/
module.exports = function(grunt) {
'use strict';
// readOptionalJSON
// by Ben Alman
// https://gist.github.com/2876125
function readOptionalJSON( filepath ) {
var data = {};
try {
@HoundstoothSTL
HoundstoothSTL / facebook_feed
Created January 16, 2013 16:11
Facebook Timeline RSS feed URL format
http://www.facebook.com/feeds/page.php?id=XXXXXXXXXXXXX&format=rss20
@HoundstoothSTL
HoundstoothSTL / compass.rb
Created January 21, 2013 22:59
Compass config file
# ==============================================================================
# REQUIRED 3RD PARTY COMPASS EXTENSIONS
# ==============================================================================
# ==============================================================================
# COMPASS PROJECT CONFIGURATION
# ==============================================================================
# Can be `:stand_alone` or `:rails`. Defaults to `:stand_alone`.