Skip to content

Instantly share code, notes, and snippets.

View evanblack's full-sized avatar

Evan Black evanblack

  • Salesforce
  • Indianapolis, IN
View GitHub Profile
# Set system limits for open files/processes
ulimit -n 2048
# Main Aliases
alias be='subl ~/.bash_profile; source ~/.bash_profile'
alias ss='rails server'
alias dprun='docpad run'
alias mm='middleman'
alias npmls='npm ls "$@" | grep ^[└├]'
alias npmgls='npm -g ls "$@" | grep ^[└├]'
$base-font-size: 16px;
$base-line-height: 1.5;
// this value may vary for each font
// unitless value relative to 1em
$cap-height: 0.68;
@mixin baseline($font-size, $scale: 2) {
@evanblack
evanblack / console-log-object.js
Created February 27, 2014 20:12
A quick and dirty way of console logging all of an object's properties. There's probably an easier way of doing this in dev tools...
var output = '';
for (var property in someObject) {
output += property + ': ' + someObject[property]+'; ';
}
console.log(output);
@evanblack
evanblack / gulpfile.js
Created February 10, 2014 15:19 — forked from MoOx/gulpfile.js
///
var pkg = require("./package.json")
, gulp = require("gulp")
, gutil = require("gulp-util")
, concat = require("gulp-concat")
///
// HTML (Jade)
///
var jade = require("gulp-jade")
# Variables referenced:
# [project-name]: a name you make up as your project folder on the server.
# [repository-name]: the short name of your beanstalk repository
# [git-branch]: the proper git branch for this particular environment
# Context set to:
# /var/www/[dev|qa|uat]/[project-name]
# Nginx Serves:
# /var/www/[dev|qa|uat]/[project-name]/build
@evanblack
evanblack / WYSIWYG_p_utility.js
Created May 3, 2013 16:34
An example snippet of a jQuery Utility function that wraps text nodes within a div with a proper 'p' tag. Gets around limitations with pasting text in the WYSIWYG editor in SiteCore.
// Utility function to wrap 'page-content' text nodes with <p> tags
$('.page-content').contents().filter(function() {
var whitespace = /^\s*$/;
if(this.nodeType === 3 && !whitespace.test(this.nodeValue)){
return true;
}
}).wrap("<p>");
@evanblack
evanblack / css-code-standards.md
Created February 16, 2013 04:03
CSS Code Standards

CSS Styleguide

This document outlines my personal approach on efficient, adaptable and scalable CSS development. Generally inspired by ideas from SMACSS and OOCSS. See also necolas/idiomatic-css. View a practical example displaying principles defined in this guide.

Note: the term "object" in this guide refer to objects represented in the DOM tree.

@evanblack
evanblack / mixin-micro-clearfix.scss
Last active December 13, 2015 17:29
SCSS clearfix mixin based on Nicolas Gallagher's micro-clearfix method
@mixin clearfix-micro() {
& {
*zoom: 1;
}
&:before,
&:after {
content: "";
display: table;
}
&:after {
@evanblack
evanblack / mixin-retina-background.scss
Last active December 13, 2015 17:28
Retina CSS Background Image Mixin to easily reference @2x sizes. From: http://37signals.com/svn/posts/3271-easy-retina-ready-images-using-scss
@mixin image-2x($image, $width, $height) {
@media (min--moz-device-pixel-ratio: 1.3),
(-o-min-device-pixel-ratio: 2.6/2),
(-webkit-min-device-pixel-ratio: 1.3),
(min-device-pixel-ratio: 1.3),
(min-resolution: 1.3dppx) {
/* on retina, use image that's scaled by 2 */
background-image: url($image);
background-size: $width $height;
}