Skip to content

Instantly share code, notes, and snippets.

View og-shawn-crigger's full-sized avatar

Shawn Crigger og-shawn-crigger

View GitHub Profile
@og-shawn-crigger
og-shawn-crigger / favicon.sh
Last active June 15, 2022 23:53
favicon icon generator shell script
#!/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
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
@og-shawn-crigger
og-shawn-crigger / gist:5745734
Last active December 18, 2015 07:19 — forked from jcanfield/gist:4522006
Copy SSH Keys to Remote Server
# Copy SSH Keys to Remote Server (for password-less access)
#
# More information copying SSH Keys to remote servers can be found at, https://help.ubuntu.com/community/SSH/OpenSSH/Keys.
# Method One is to create a simple script.
# I typically create the script in my ~/.bin and symbolically it to my /usr/local/sbin.
# $ touch ~/.bin/copykeys.sh
# $ chmod +x ~/.bin/copykeys.sh
# $ nano ~/.bin/copykeys.sh
# $ sudo ln -s /home/yourusername/.bin/copykeys.sh /usr/local/sbin/copy-ssh-key
@og-shawn-crigger
og-shawn-crigger / viewsource.sh
Created June 9, 2013 23:40 — forked from jcanfield/viewsource.sh
Bash script to view source of url entered with pygmentized syntax highlighter
#!/bin/bash
# View Website source with syntax highlighting via Pygmentize
echo "Viewing Source for $1"
read -p "USAGE: viewsource http://www.website.com/ (Press Enter To Continue)"
curl -s "$1" | pygmentize -f terminal256 -l html -O style=monokai
exit
@og-shawn-crigger
og-shawn-crigger / .htaccess
Created June 9, 2013 23:39 — forked from jcanfield/.htaccess
Wordpress .htaccess boilerplate to look at
# Apache Configuration file
# www.lighthouselutherie.com/.htaccess
# Use UTF-8 encoding for anything served as `text/html` or `text/plain`.
AddDefaultCharset utf-8
# Force UTF-8 for certain file formats.
<IfModule mod_mime.c>
AddCharset utf-8 .atom .css .js .json .rss .vtt .webapp .xml
</IfModule>
@og-shawn-crigger
og-shawn-crigger / wp-config.php
Created June 9, 2013 23:38 — forked from jcanfield/wp-config.php
Turns wordpress debugging on creates log in wp-content/ directory if I remember correctly.
@ini_set('display_errors',0); /* define('WP_DEBUG', false); */
define('WP_DEBUG', true); // Turn debugging ON
define('WP_DEBUG_DISPLAY', false); // Turn forced display OFF
define('WP_DEBUG_LOG', true);
@og-shawn-crigger
og-shawn-crigger / functions.php
Created June 6, 2013 15:12 — forked from jcanfield/functions.php
Add body classes to Wordpress <body> tag
// Add more options to the body class on each page (Previous the Ambrosite Plugin)
function fineideas_body_class($classes) {
// If you don't like the class prefixes I have chosen, you can change them here.
$post_name_prefix = 'postname-';
$page_name_prefix = 'pagename-';
$single_term_prefix = 'single-';
$single_parent_prefix = 'parent-';
$category_parent_prefix = 'parent-category-';
$term_parent_prefix = 'parent-term-';
<?
/**
* Repeatable Custom Fields in a Metabox
* Author: Helen Hou-Sandi
*
* From a bespoke system, so currently not modular - will fix soon
* Note that this particular metadata is saved as one multidimensional array (serialized)
*/
function hhs_get_sample_options() {
@og-shawn-crigger
og-shawn-crigger / MAMP-DOCK-INVISIBLE.sh
Last active December 10, 2015 20:18 — forked from josue/MAMP-DOCK-INVISIBLE.sh
Hide MAMP Dock Icons Shell Scripts
#!/bin/bash
# Place this script in dir: /usr/bin
# Change permissions: sudo chmod +x /usr/bin/MAMP-DOCK-INVISIBLE
#
# Ensure the MAMP 'Info.plist' file has the following entry:
# <key>LSUIElement</key>
# <string dock-visible="1">NO</string>
#
# Usage:
@og-shawn-crigger
og-shawn-crigger / mimeapps.list
Created September 6, 2012 11:02 — forked from marfillaster/mimeapps.list
Sublime Text ubuntu xdebug url handler
#~/.local/share/applications/mimeapps.list
[Added Associations]
#...
x-scheme-handler/subl=subl-urlhandler.desktop