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
@jcanfield
jcanfield / .bash_aliases
Created July 10, 2018 19:56 — forked from insane-dev/.bash_aliases
Commonly used bash aliases
#!/bin/bash
# Colors
RED='\033[0;31m'
BLACK='\033[0;30m'
DARK_GRAY='\033[1;30m'
LIGHT_RED='\033[1;31m'
GREEN='\033[0;32m'
LIGHT_GREEN='\033[1;32m'
BROWN_ORANGE='\033[0;33m'
@jcanfield
jcanfield / .bash_profile
Created October 30, 2015 10:55 — forked from natelandau/.bash_profile
Mac OSX Bash Profile - Sections: # 1. Environment Configuration # 2. Make Terminal Better (remapping defaults and adding functionality) # 3. File and Folder Management # 4. Searching # 5. Process Management # 6. Networking # 7. System Operations & Information # 8. Web Development # 9. Reminders & Notes
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@jcanfield
jcanfield / tmux-new.sh
Created September 11, 2022 18:55
Simple Bash Script to Create a New Session
#!/bin/bash
# USAGE: ./tmux-new.sh SESSION_NAME
#
# Credit to Keon Woortman
# URL: https://koenwoortman.com/tmux-sessions-should-be-nested-with-care-unset-tmux-to-force/
session_name="$1"
# 1. First you check if a tmux session exists with a given name.
tmux has-session -t=$session_name 2> /dev/null
@jcanfield
jcanfield / openNIC-public-dns-server-list.md
Last active August 31, 2022 15:39
OpenNIC Public Servers - Last Updated on October 31, 2015

OpenNIC Public Servers

(Source Link)

Hostname | IPv4 | IPv6 | Owner(s) | Added | Status

  • ns2.tx.us.dns.opennic.glue | 69.164.196.21 | purrdeta | 2011-Aug-06 | (Pass)
  • ns1.co.us.dns.opennic.glue | 216.87.84.211| 2001:470:8388:10:0:100:53:20 | shdwdrgn | 2011-Aug-06 | (Pass)
  • ns4.tx.us.dns.opennic.glue | 2600:3c00::02:f053 | purrdeta | 2011-Aug-06 | (Pass)
  • ns2.co.us.dns.opennic.glue | 2001:470:8388:10:0:100:53:20 | shdwdrgn | 2011-Aug-06 | Remove
  • ns10.tx.us.dns.opennic.glue | 2600:3c00::20:b1ff | bersl2 | 2012-Feb-24 | (Pass)
@jcanfield
jcanfield / cache.htaccess
Created August 10, 2012 22:49 — forked from kurtpayne/cache.htaccess
.htaccess caching rules
<IfModule mod_mime.c>
# Text
AddType text/css .css
AddType application/x-javascript .js
AddType text/html .html .htm
AddType text/richtext .rtf .rtx
AddType text/plain .txt
AddType text/xml .xml
@jcanfield
jcanfield / aria2c_webUI.md
Created January 31, 2022 10:38 — forked from GAS85/aria2c_webUI.md
Aria2 + Ubuntu 18.04 + Apache2 + Web UI
OS: Ubuntu 18.04 Apache/2.4.18 1.0.2g-1ubuntu4.10
Aim: to install Aria2 with WebUI and secure Token.
IP Addr of your Aria2 server is 192.168.0.111
Your local IP network is 192.168.0.0/24

Aria 2

1. Installation

Install aria2 package:

@jcanfield
jcanfield / googlemaps_canvas.html
Created September 20, 2012 03:40
Driving Directions URL for usage with Google Maps API and Custom infoWindow
<!DOCTYPE html>
<html>
<head>
<title>Google Maps API and Driving Directions</title>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=true"></script>
<script type="text/javascript">
function initialize() {
var myLatlng = new google.maps.LatLng(39.928294, -105.147710);
var mapOptions = {
zoom: 15,
@jcanfield
jcanfield / checkserverheads.js
Created August 19, 2012 18:06
Check Server Headers Bookmarklet
// Bookmarklet by Joshua Canfield (Code Clarity -- www.icodeclarity.com)
// Using URI-Valet services
javascript:var url = prompt("Enter Domain to check Server Headers");window.open('http://urivalet.com/?'+ url, '_blank');
@jcanfield
jcanfield / msie-vmwarefusion-osx.bash
Created April 3, 2013 02:56
Download the latest VMWare Fusion images from Modern.IE for Internet Explorer Testing. This bash script is primitive and simple. Anybody who would like to expand on this is more than welcome to.
#!/bin/bash
# Download all VMWare Fusion machines from Modern.IE Website to test your Website/Web Application in Microsoft Internet Explorer on Mac OSX. All VM's and other VM's for Windows and Linux and other Virtual Manager's such as VirtualBox can be found at http://modern.ie/
# Don't have cURL or want to learn more, visit http://curl.haxx.se/.. are you really a Developer? First part of that sentence comes from the MS site.
read -p "--> Downloading Internet Explorer 6-10 on Windows XP/7/8 Appliances for VMWare Fusion. Large downloads ahead. (Press Enter to continue)."
echo "--> Download Internet Explorer 6 on Microsoft Windows XP Appliance for VMWare Fusion."
curl --progress-bar -O "http://virtualization.modern.ie/vhd/IEKitV1_Final/VMWare_Fusion/IE6_XP/IE6.XP.For.MacVMware.sfx"
echo "--> Download Internet Explorer 8 on Microsoft Windows XP Appliance for VMWare Fusion."
@jcanfield
jcanfield / index.php5
Last active June 25, 2020 22:56
Wordpress Image Attachment Recipes > Post by DigWP.com which can be found at http://digwp.com/2009/08/awesome-image-attachment-recipes-for-wordpress/. > Even though this is an older post there are a few very simple Wordpress functions and methods utilizing Post Images with-in your code.
/*****
* Basic display of gallery attachments
* When displaying your images via the [gallery] shortcode, WordPress will display image-links for each image in the gallery. Each of these image-links points to the image-gallery page for that particular image. The image gallery is created by the image.php template if present in your theme files. Here is a basic way to display your gallery images from within the image-gallery loop:
*****/
<a href="<?php echo wp_get_attachment_url($post->ID); ?>"><?php echo wp_get_attachment_image($post->ID, 'medium'); ?></a>
/*****
* Display the URL of the latest image attachment
* Perhaps the most useful template tag for displaying image-attachment information is wp_get_attachment_url(). This function returns a full URI for an attachment file. If no attachment is found, a value of false is returned. Here are several ways to use this tag within the loop: