Skip to content

Instantly share code, notes, and snippets.

@jeffreysbrother
jeffreysbrother / package.json
Created March 19, 2016 06:55
functioning instance of grunt-contrib-imagemin
{
"name": "jeffreysbrother.com",
"version": "1.0.0",
"description": "portfolio site",
"main": "index.php",
"dependencies": {
"flightplan": "^0.6.4",
"fly": "^0.8.3",
"imagemin-mozjpeg": "^5.1.0"
},
@jeffreysbrother
jeffreysbrother / align.css
Created August 26, 2016 16:30
align content vertically by applying this class to the content's parent container
.vertical-align {
display: flex;
align-items: center;
}
@jeffreysbrother
jeffreysbrother / validation.js
Last active September 14, 2016 03:09
Add jQuery form validation where HTML5 validation is not supported (Safari)
$("form").submit(function(e) {
var ref = $(this).find("[required]");
$(ref).each(function() {
if ( $(this).val() == '' ) {
alert("Required field should not be blank.");
$(this).focus();
e.preventDefault();
return false;
@jeffreysbrother
jeffreysbrother / config.json
Last active October 7, 2016 21:36
Boostrap config with no JS and only necessary CSS. Entire folder size: 181.7 kB versus 1.7 MB.
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
@jeffreysbrother
jeffreysbrother / commit-msg
Created October 10, 2016 17:19
Add branch name to beginning of commit message
# add file to {projectname}/.git/hooks/
# please ensure that the .sample extension is not included
NAME=$(git branch | grep '*' | sed 's/* //')
DESCRIPTION=$(git config branch."$NAME".description)
echo "$NAME"' '$(cat "$1") > "$1"
if [ -n "$DESCRIPTION" ]
then
echo "" >> "$1"
{
"always_show_minimap_viewport": true,
"color_scheme": "Packages/Colorsublime - Themes/Boron.tmTheme",
"font_face": "Fira Code",
"font_size": 11,
"hot_exit": false,
"ignored_packages":
[
"Vintage"
],
//activate custom fields in wordpress and name that field. Replace 'about_blurb' below with the selected name (I don't think hyphens can be used here)
<?php $meta_value = get_post_meta($post->ID, 'about_blurb', true);
if (!empty($meta_value)) {
echo '<p>' . $meta_value . '</p>';
} ?>
//however, we can use the Advanced Custom Fields plugin for something much better
//this goes in our template file:
@jeffreysbrother
jeffreysbrother / Preferences.sublime-settings2
Created May 29, 2017 00:50
2016/2017 Sublime Text settings ... influenced by the Laracasts guy.
{
"always_show_minimap_viewport": true,
"color_scheme": "Packages/User/SublimeLinter/Facebook (SL).tmTheme",
"font_face": "Fira Code",
"font_size": 15,
"hot_exit": false,
"ignored_packages":
[
"Vintage"
],
@jeffreysbrother
jeffreysbrother / settings.json
Last active June 13, 2017 17:28
Visual Studio Code settings.json
// Place your settings in this file to overwrite the default settings
{
"editor.fontSize": 15,
"editor.lineHeight": 23,
"editor.roundedSelection": false,
"editor.renderIndentGuides": true,
"editor.tabCompletion": true,
"editor.matchBrackets": false,
"subtleBrackets.style": {
"borderWidth": "1px",
@jeffreysbrother
jeffreysbrother / .vimrc
Last active December 5, 2017 18:24
2017 work .vimrc
set runtimepath+=~/.vim_runtime
source ~/.vim_runtime/vimrcs/basic.vim
source ~/.vim_runtime/vimrcs/filetypes.vim
source ~/.vim_runtime/vimrcs/plugins_config.vim
source ~/.vim_runtime/vimrcs/extended.vim
try
source ~/.vim_runtime/my_configs.vim
catch