Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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;
}
//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 / 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 / Gruntfile.js
Created March 19, 2016 06:53
grunt-contrib-imagemin with additional plugin
module.exports = function(grunt) {
//additional plugin installed:
var mozjpeg = require('imagemin-mozjpeg');
//project configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
imagemin: {
@jeffreysbrother
jeffreysbrother / Gruntfile.js
Created March 2, 2016 23:15
Automatically inline all the CSS in an HTML email (using the grunt-inline-css plugin by jgallen23)
module.exports = function(grunt) {
grunt.initConfig({
inlinecss: {
main: {
options: {
removeStyleTags: false,
preserveImportant: true,
preserveMediaQueries: true,
webResources: {
@jeffreysbrother
jeffreysbrother / styles.less
Last active February 17, 2016 00:53
Atom stylesheet
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed and saved.
*
* Add your own CSS or Less to fully customize Atom.
* If you are unfamiliar with Less, you can read more about it here:
* http://lesscss.org
*/
@jeffreysbrother
jeffreysbrother / .vimrc
Created February 10, 2016 23:19
this is my functioning .vimrc file (before updating it according to the ctrlpvim suggestions)
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
@jeffreysbrother
jeffreysbrother / snippets.json
Last active October 13, 2015 23:59
a list of useful (uncustomized) snippets for emmet
//this is not a JSON file. these are emmet snippets controlled by the snippets.json file
link:css
meta:vp
btn:s