Skip to content

Instantly share code, notes, and snippets.

View dobsondev's full-sized avatar

Alex Dobson dobsondev

View GitHub Profile
@dobsondev
dobsondev / Preferences.sublime-settings
Last active August 29, 2015 13:56
Sublime Text User Preferences
{
"font_size": 12.0,
"hot_exit": false,
"ignored_packages":
[
"Vintage"
],
"open_files_in_new_window": false,
"remember_open_files": false,
"soda_classic_tabs": true,
@dobsondev
dobsondev / .bash_profile
Last active July 23, 2019 14:42
My personal .bash_profile file on my Mac. It styles my bash prompt in a way I like and also adds some useful alias.
# ~/.bash_profile
[[ -s ~/.bashrc ]] && source ~/.bashrc
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
alias subl='/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl'
alias ls='ls -GFh'
alias ll='ls -l'
@dobsondev
dobsondev / Preferences.sublime-settings
Last active August 29, 2015 13:56
My personal settings for Sublime Text 2.
{
// The default font size is 10 which is a little small for me
"font_size": 12.0,
// The number of spaces a tab is considered equal to
"tab_size": 2,
// Set to true to insert spaces when tab is pressed
"translate_tabs_to_spaces": true,
@dobsondev
dobsondev / embedPDF-shortcode.php
Created March 25, 2014 17:48
Shortcode for Embedding PDF's - Used in DobsonDev Shortcodes Plugin for WordPress
<?php
/* Adds a shortcode for displaying PDF's Inline */
function dobson_embed_PDF($atts) {
extract(shortcode_atts(array(
'source' => "Invalid Source",
'width' => "100%",
'height' => "600",
), $atts));
$source_headers = @get_headers($source);
@dobsondev
dobsondev / embedGist-shortcode.php
Created March 25, 2014 17:49
Shortcode for Embedding GitHub Gist's - Used in DobsonDev Shortcodes Plugin for WordPress
<?php
/* Adds a shortcode for displaying GitHub Gists */
function dobson_create_github_gist($atts) {
extract(shortcode_atts(array(
'source' => "Invalid Source",
), $atts));
$source_headers = @get_headers($source);
if (strpos($source_headers[0], '404 Not Found')) {
return '<p> Invalid GitHub Gist source. Please check your source. </p>';
@dobsondev
dobsondev / embedTwitchStream-shortcode.php
Created March 25, 2014 17:50
Shortcode for Embedding a Twitch.tv Stream - Used in DobsonDev Shortcodes Plugin for WordPress
<?php
/* Adds a shortcode to embed a Twitch Stream */
function dobson_embed_twitch($atts) {
extract(shortcode_atts(array(
'username' => "Invalid Username",
'width' => "620",
'height' => "378",
), $atts));
$source_headers = @get_headers("http://twitch.tv/" . $username);
@dobsondev
dobsondev / embedTwitchChat-shortcode.php
Created March 25, 2014 18:00
Shortcode for Embedding a Twitch.tv Stream Chat - Used in DobsonDev Shortcodes Plugin for WordPress
<?php
/* Adds a shortcode to embed a Twitch Stream's chat */
function dobson_embed_twitch_chat($atts) {
extract(shortcode_atts(array(
'username' => "Invalid Username",
'width' => "350",
'height' => "500",
), $atts));
$source_headers = @get_headers("http://twitch.tv/chat/embed?channel=" . $username . "&popout_chat=true");
@dobsondev
dobsondev / embedYouTube-shortcode.php
Created March 25, 2014 18:01
Shortcode for Embedding a YouTube Video - Used in DobsonDev Shortcodes Plugin for WordPress
<?php
/* Adds a shortcode to embed a YouTube video */
function dobson_embed_youtube($atts) {
extract(shortcode_atts(array(
'video' => "Invalid Video ID",
'width' => "560",
'height' => "315",
), $atts));
$source_headers = @get_headers("http://youtube.com/watch?v=" . $video);
@dobsondev
dobsondev / CapitalizeAlphabetical.java
Created April 2, 2014 17:53
Small Java program that will take in a file full of words seperated into lines and capitalizes those words and sorts them alphabetically.
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;
public class CapitalizeAlphabetical {
@dobsondev
dobsondev / Differences-Between-Directories.sh
Created May 14, 2014 16:46
Show the differences between two directories.
diff <(cd dir1 ; ls -1 | sort) <(cd dir2 ; ls -1 | sort)