Skip to content

Instantly share code, notes, and snippets.

View EvanLovely's full-sized avatar

Evan Lovely EvanLovely

View GitHub Profile
@mixin retina-inline-image($img, $fallback) {
background-image: inline-image($img);
background-size: (image-width($img) / 2) (image-height($img) / 2);
.no-backgroundsize & {
background-image: image-url($fallback);
}
}
@EvanLovely
EvanLovely / Get_front_Mac_App_URL--markdown.applescript
Created May 27, 2014 22:05
Get Front Mac App Title and URL and make a Markdown Link to it
# Grab a URL from Chrome, Safari, Mail, Contacts, Finder, TextEdit, Omnifocus, Chrome Canary, or FoldingText
# Borrowed from: http://www.alfredforum.com/topic/917-reminders/?hl=reminders
tell application (path to frontmost application as text)
set theApplication to get name
end tell
set theText to ""
set theBody to ""
if theApplication is "Google Chrome" then
tell application id "com.google.chrome"
--Script for setting Reminders for LaunchBar and Alfred
--For Alfred, Applescript must NOT be set to run in Background otherwise date parsing does not work
--For LaunchBar, place the script in ~/Library/Scripts/LaunchBar
--by Michelle L. Gill, 10/07/2012
--Inspired by https://gist.github.com/3187630
--A related Alfred version 2 workflow can be found here: https://github.com/mlgill/alfred-workflow-create-reminder
--Changes
--02/01/2013 * Fixed an issue with setting the time when the hour is 12 and AM/PM (12-hour clock) is used
-- * Removed the ability to set seconds for the time since Reminders doesn't recognize them
@EvanLovely
EvanLovely / Make new Reminder.applescript
Created May 17, 2014 22:17
Create a new Apple Reminder with AppleScript
set _name to "name"
set _note to "note"
tell application "Reminders"
make new reminder with properties {name:_name, body:_note}
end tell
@EvanLovely
EvanLovely / Make new Reminder due in 3 days.applescript
Last active October 29, 2021 23:16
Create a new Apple Reminder due in 3 days with AppleScript
set _name to "name"
set _note to "note"
tell application "Reminders"
make new reminder with properties {name:_name, body:_note, due date:((current date) + 3 * days)}
end tell
@EvanLovely
EvanLovely / SassMeister-input.scss
Created May 5, 2014 21:03
Generated by SassMeister.com.
// ----
// Sass (v3.3.6)
// Compass (v1.0.0.alpha.18)
// ----
body.product {
.select {
color: blue;
.product--special & {// I want this to be body.product.product--special .select
color: red;
@EvanLovely
EvanLovely / img-sizes.sh
Created April 26, 2014 01:29
Display image sizes in the command line for either a single image or a whole directory
# Run on an image to see it's width & height in pixels, then copy the CSS syntax for it.
imgsize () {
width=$(mdls -name kMDItemPixelWidth -raw "$1")
height=$(mdls -name kMDItemPixelHeight -raw "$1")
echo "width: "$width"px;
height: "$height"px;" | pbcopy
echo "$width"x"$height"
}
# Displays all images in a directory with image sizes. Either pass in a folder or run as-is to list the current directory
@EvanLovely
EvanLovely / bash_functions.sh
Created April 16, 2014 19:23
Git Checkout Helper
# Git Checkout Helper
gitco() {
git branch
echo "Branch to checkout? (Fuzzy searching from left to right with space support)"
read branch
branches=$(git branch | egrep -i "${branch// /.*}" | tr -d ' ')
count=$(echo "$branches" | egrep -c ".")
if [ "$count" = "1" ]; then
git checkout $(echo $branches | tr -d '\n' | tr -d '*')
elif [[ "$count" = "0" ]]; then
@EvanLovely
EvanLovely / Double-Negative-Borders.markdown
Created February 20, 2014 01:51
A Pen by Evan Lovely.