Skip to content

Instantly share code, notes, and snippets.

View codyjlandstrom's full-sized avatar

Cody J Landstrom codyjlandstrom

View GitHub Profile

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@codyjlandstrom
codyjlandstrom / Mac Apps and Services.md
Last active December 16, 2015 07:29
A list of Apps and Services being used on my machines

Apps and Services Used Across Machines

General Apps

Developers Apps/Services

  • Adobe Creative Suite CS6
@codyjlandstrom
codyjlandstrom / gist:7254062
Created October 31, 2013 17:55
Wordpress Snippets
/************* ADD FEATURE IMAGES TO RSS FEED *****************/
function featured_image_in_feed( $content ) {
global $post;
if( is_feed() ) {
if ( has_post_thumbnail( $post->ID ) ){
$output = get_the_post_thumbnail( $post->ID, 'large', array( 'style' => 'float:right; margin:0 0 10px 10px;' ) );
$content = $output . $content;
}
}
@codyjlandstrom
codyjlandstrom / favicon.txt
Last active August 29, 2015 13:56
Force a favicon refresh.
<link rel="shortcut icon" href="http://www.yoursite.com/favicon.ico?v=2" />
@codyjlandstrom
codyjlandstrom / gist:9179870
Last active August 29, 2015 13:56
Wordpress update url for singular database in development
/* For use on localhost only. */
if($_SERVER['SERVER_NAME'] != 'http://site.com') {
define('WP_SITEURL' , 'http://' . $_SERVER['SERVER_NAME']);
define('WP_HOME' , 'http://' . $_SERVER['SERVER_NAME']);
define('WP_CONTENT_DIR', dirname( __FILE__ ) . '/wp-content');
define('WP_CONTENT_URL', 'http://' . $_SERVER['SERVER_NAME'] . '/wp-content');
}
@codyjlandstrom
codyjlandstrom / gist:9182590
Created February 24, 2014 05:49
Wordpress - enqueue jQuery from Google CDN
//jQuery Insert From Google
if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);
function my_jquery_enqueue() {
wp_deregister_script('jquery');
wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js", false, null);
wp_enqueue_script('jquery');
}
@codyjlandstrom
codyjlandstrom / gist:9211733
Last active August 29, 2015 13:56
Command Line base64 SVG - copy to clipboard
echo -n `cat logo.svg` | base64 | pbcopy
openssl base64 < path/to/file.png | tr -d '\n' | pbcopy
# Skip writing the file and just copy the base64
cat path/to/file.png | openssl base64 | tr -d '\n' | pbcopy
In Sublime Text w/ Emmet:
- place cursor in file url
- control + shift + d
@codyjlandstrom
codyjlandstrom / gist:9260479
Last active August 29, 2015 13:56
.htaccess X-UA-Compatible for attribute http-equiv on element meta
# Fix page validation by adding X-UA-Compatible here
<FilesMatch "\.(htm|html|php)$">
<IfModule mod_headers.c>
BrowserMatch MSIE ie
Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
</IfModule>
</FilesMatch>
@codyjlandstrom
codyjlandstrom / referers
Created March 17, 2014 17:31
S3 Bucket Policy - Only allow HTTP requests from specific referers
{
"Version": "2012-10-17",
"Id": "http referer policy example",
"Statement": [
{
"Sid": "Allow get requests referred by www.mysite.com and mysite.com",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::examplebucket/*",
@codyjlandstrom
codyjlandstrom / gradient.css
Created March 19, 2014 16:01
Text section with color gradient
p {
background: -webkit-linear-gradient(top,#fd0b58 0,#a32b68 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}