Skip to content

Instantly share code, notes, and snippets.

View jlengstorf's full-sized avatar
💭
partyin

Jason Lengstorf jlengstorf

💭
partyin
View GitHub Profile
@jlengstorf
jlengstorf / gist:2864077
Created June 3, 2012 16:25
.htaccess commands to increase max upload file size.
php_value upload_max_filesize 20M
php_value post_max_size 20M
@jlengstorf
jlengstorf / gist:2898957
Last active October 5, 2015 23:57
Find all files over 10MB in size.
find / -mount -noleaf -type f -size +10000k -print0 | xargs -0 ls -lhSr | awk '{printf "%*s %s\n",7,$5":",$9}'
@jlengstorf
jlengstorf / gist:3889744
Created October 14, 2012 20:36
Search for all occurrences of a string, case-insenstive, within the current dir and its subdirs. Returns the file name & line number, plus the matched line
grep -rni "STRING" .
@cobyism
cobyism / gh-pages-deploy.md
Last active July 29, 2024 06:33
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@jlengstorf
jlengstorf / git_rm_ls-files.sh
Last active December 12, 2015 08:28
Git command to remove all deleted files
# Removes all deleted files
git rm $(git ls-files -d)
# Removes deleted files in a given directory
git rm $(git ls-files -d path/to/subdir/.)
@jlengstorf
jlengstorf / wp-img-defaults.css
Created February 26, 2013 23:06
Default styling for WordPress image alignment and captions
/*
* Default WP Alignment Classes
*****************************************************************************/
.aligncenter,.alignleft,.alignright {
display: block;
padding: 0;
}
.aligncenter {
@jlengstorf
jlengstorf / .htaccess
Created February 28, 2013 21:59
Apache configuration for forcing a secure connection to the site.
# Force SSL
RewriteCond %{SERVER_PORT} !443$
RewriteRule ^(.*)$ https://www.example.org/$1 [L]
@jlengstorf
jlengstorf / README.md
Last active September 10, 2018 01:50
Removes the junk that wpautop adds to shortcodes in WordPress.

Remove Crappy Markup from WordPress Shortcodes

When using shortcodes in WordPress like so:

[shortcode]

Content goes here...

[/shortcode]

@staltz
staltz / introrx.md
Last active July 31, 2024 09:30
The introduction to Reactive Programming you've been missing
@jlengstorf
jlengstorf / README.md
Created October 8, 2014 20:28
Adds responsive embedding to WordPress oEmbed content.

Responsive Embeds in WordPress

This snippet filters oEmbed output in WordPress (the_content()) to force responsive embeds.

Usage

To use, add the contents of responseive_embeds.less to your site's stylesheet (if you're not using LESS, don't forget to move the iframe,object,embed rule outside of .embed-container and change it to .embed-container iframe,.embed-container object,.embed-container embed).

Then add the responsive_embed() function to your theme's functions.php and insert the add_filter() call in your theme's setup function.