Skip to content

Instantly share code, notes, and snippets.

View jcanfield's full-sized avatar
💭
If I do not respond quickly, try me on Twitter at @creativeboulder.

Joshua Canfield jcanfield

💭
If I do not respond quickly, try me on Twitter at @creativeboulder.
View GitHub Profile
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
###############################################################################
# Copyright 2012 Jakub Jirutka. All rights reserved.
#
# "THE KOFOLA-WARE LICENSE" (Revision 1):
# Jakub Jirutka originally wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a Kofola in return. <jakub@jirutka.cz>
#
###############################################################################
#!/bin/bash
# Favicon and Apple Touch Icon Generator
#
# This bash script takes an image as a parameter, and uses ImageMagick to convert it to several
# other formats used on modern websites. The following copies are generated:
#
# * apple-touch-icon-144x144-precomposed.png
# * apple-touch-icon-114x114-precomposed.png
# * apple-touch-icon-57x57-precomposed.png
#!/bin/sh
# Place in /etc/motd.d and drop the .sh suffix.
echo -e "\n\033[1mWelcome to Gentoo Linux!\033[0m"
echo -e "\nThis server is maintained by \033[1m$(cat /etc/maintainer)\033[0m."
echo -e "Contact \033[1m$(cat /etc/maintainer-address)\033[0m for support."
echo en "\n \033[1;32m*\033[0m "

What if controlling your media queries was as easy as adding on to a Sass list? What if I told you it now is?

This snippet comes from a modified version of mixins in the Aura Responsive Framework and came from me hijacking the respond-to mixin namespace but still wanting to use it for custom media queries. It's a little ugly and requires Sass 3.2+ (for now, (sudo) gem install sass --pre), but it works a charm.

There are two fairly mundane caveats to this method. First, every media query needs to be named. Second, every media query needs a size and assumes min-width and screen. If you want to change min-width, simply add your operator as another option, but if you want to change screen, you need to also include your operator even if you want it to be min-width.

Also, I haven't built in warnings yet for when you do bad things, so bear that in mind.

Without further adue, tada.

@jcanfield
jcanfield / my_ip.sh
Last active January 1, 2016 03:29 — forked from jeroen/getip.sh
Bash script for *nix systems to display your Public IP Address.
#!/bin/bash
# Display Public IP Address
# USAGE: my_ip
# Other Commands:
# `wget -qO- ifconfig.me/ip`
# `curl ifconfig.me`
# `wget -qO- http://shtuff.it/myip/short`
echo "--> Displaying your Public IP Address.."
<?php
/**
* Listing_Image is a sample class for demonstrating the PDO::FETCH_CLASS method, like a boss.
*
* Example usage:
*<code>
* $img = $q->fetch(PDO::FETCH_CLASS, "Listing_Image");
* echo $img->get_image_tag();
*</code>

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

@jcanfield
jcanfield / osx-10.10-setup.md
Last active August 29, 2015 14:12 — forked from kevinelliott/osx-10.10-setup.md
Josh's Blank Canvas for an OSX Reinstall based upon the work of kevinelliott/osx-10.10-setup.md. (Please note that below the Homebrew Installation I have not modified. There are a few Tools that I use differently. For instance, I am a Sublime Text 3 user, Vagrant and iTerm2 User.)

Mac OS X 10.10 Yosemite

Let's get started. Kevin did a great job on setting up this Gist. My goal is to refine it and retool it to work with my my OSX and Development environments. So here were f*cking go..

Install Software

The software selected is software that is "tried and true" --- software I need after any fresh install. I often install other software not listed here, but is handled in a case-by-case basis.

Install from App Store

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title><?php echo $post->title; ?></title>
<link rel="stylesheet" href="https://www.drmcdougall.com/wp/wp-admin/load-styles.php?c=1&amp;dir=ltr&amp;load=dashicons,wp-admin,buttons,wp-auth-check&amp;ver=4.1" type="text/css" media="all">
</head>
<body>
<div class="wrap">