Skip to content

Instantly share code, notes, and snippets.

View EvanLovely's full-sized avatar

Evan Lovely EvanLovely

View GitHub Profile
ps xmo rss=,pmem=,comm= | while read rss pmem comm; ((n++<5)); do
size="$[rss/1024]";
short=$[4-${#size}];
size="(${size}M)";
i=0;
while ((i++ < short)); do size=" $size"; done;
pmem="${pmem%%.*}"
if (($pmem >= 20)); then color=$'\e[31m';
@EvanLovely
EvanLovely / SassMeister-input.scss
Last active August 29, 2015 14:09
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.1)
// ----
@mixin icon-overlay-base {
background: white;
font-size: 154px;
opacity:0.75;
padding: 39px 0 0 0;
@EvanLovely
EvanLovely / SassMeister-input.scss
Created September 25, 2014 21:31
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.1)
// ----
.block {
color: red;
&__title {
text-transform: uppercase;
}
@EvanLovely
EvanLovely / SassMeister-input.scss
Last active August 29, 2015 14:06
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.1)
// ----
.block {
color: red;
&__title {
text-transform: uppercase;
}
Running "modernizr:dist" (modernizr) task
Enabled Extras
>> shiv
>> load
>> cssclasses
Looking for Modernizr references
in source/js/script.js
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
@EvanLovely
EvanLovely / _responsive-width-calculator.scss
Last active August 29, 2015 14:06
Turn pixels into percentages easily. #sass__calculators
// calculate percentage widths from pixels based on site width (or other widths)
// Useage: `padding-left: res-width(10px);`
@function res-width($pixels, $container: $site-width) {
@return percentage($pixels / $container);
}
# Delete all git branches merged into master
git-branch-cleanup() {
echo "Do you want to delete remote branches? [y/n]"
read remote
echo "Do you want to delete local branches? [y/n]"
read local
echo "Which branch do you want to have as the base? All branches merged into this branch will be deleted. Defaults to master."
read branchBase
git checkout $branchBase
IFS=$'\n'
# Recursive list of files and directories
lsr() {
if [[ "$1" == "" ]]; then
N="3"
else
N="$1"
fi
find . -maxdepth "$N"
}
@EvanLovely
EvanLovely / search-scss-for-extended-classes.sh
Last active August 29, 2015 14:05
Search Sass for Extended Classes and show a report
#!/bin/bash
if [[ "$1" == "" ]]; then
echo "Please pass in the path to the Sass directory to search for extended class"
exit 1
fi
dir="$1"
uses="$(grep -rn "@extend \." "$dir")"
IFS=$'\n'
classes=""
for i in $uses; do