Skip to content

Instantly share code, notes, and snippets.

View jmuspratt's full-sized avatar
👨‍🎨

James Muspratt jmuspratt

👨‍🎨
View GitHub Profile
// Wordpress Admin bar breakpoints
$bp--admin-bar-sticks: 600px;
$bp--admin-bar-gets-taller: 783px;
// Wordpress Admin bar heights
$wp-narrow-offset: 46px;
$wp-wide-offset: 32px;
// Fixed-positioning that accounts for WP admin bar when present
# Add Git to Bash and customize PS1
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/'
}
export PS1="\n\[\e[90m\]————————————————————————————————————————————\[\e[m\]\n\w -\[\e[90m\]\$(parse_git_branch)\[\e[m\] \n$ "
// from http://commandogroup.no/wp-content/themes/Commando/js/app.js
function ajaxNav() {
$('a.home, a.project-title, a.thumbnail-title').click(function(e) {
var _gaq = _gaq || [];
var data = {
scrollTop: document.body.scrollTop
};
var path = $(this).attr('href');
var title = $(this).attr('title');
@jmuspratt
jmuspratt / keyman.cson
Last active October 14, 2015 15:49
Atom.io Settings
# Mimic Some Textmate Keyboard Shortcuts
'atom-workspace atom-text-editor:not([mini])':
'alt-cmd-[': 'editor:auto-indent'
'alt-cmd-w': 'editor:toggle-soft-wrap'
'alt-cmd-i': 'window:toggle-invisibles'
# Preserve Emmet keybindings but fix tab collision
# https://github.com/emmetio/emmet-atom/issues/225
'atom-text-editor.autocomplete-active:not([mini])':
'tab': 'autocomplete-plus:confirm'
<ul class="prev-next cf">
{% set params = {section: 'blog', order: 'postDate desc', limit: null} %}
{% set entry_prev = entry.getPrev(params) %}
{% set entry_next = entry.getNext(params) %}
{% if entry_prev %}<li class="prev"><a title="{{ entry_prev.title }}" href="{{entry_prev.url}}">Previous Post</a></li>{% endif %}
{% if entry_next %}<li class="next"><a title="{{ entry_next.title }}" href="{{entry_next.url}}">Next Post</a></li>{% endif %}
</ul>
@jmuspratt
jmuspratt / Craft CMS: Video Block
Last active August 29, 2015 14:21
Assume we're in a Matrix field called postBody which contains different kinds of blocks. videoBlock has three fields: (1) a dropdown for videoService (youtube vs. vimeo), (2) a dropdown for videoAspectRatio (ratio-16-9, ratio-4-3, etc.), and (3) a text field for videoID.
{% if entry.postBody | length %}
<div class="post-body">
{% for block in entry.postBody %}
{% switch block.type %}
{% case 'textBlock' %}
{{ block.text }}
{# cases for other blocks #}
@jmuspratt
jmuspratt / Craft CMS: Sharing Links
Last active August 29, 2015 14:20
Twitter, Linkedin, Facebook, and Email
@jmuspratt
jmuspratt / mediaName
Last active August 24, 2023 14:42
exiftool : rename files in current dir to YYYY-MM-DD-HH-MM-SS-1.ext
# Function for your .zshrc file
# Requirements: install the package manager Homebrew (http://brew.sh), then install exiftool (type brew install exiftool in Terminal.app).
# Renames image and MOV files according to EXIF capture date, using YYYY-MM-DD-HH-MM-SS.ext format.
# Files shot within the same second get copy number added (-1,-2, etc.).
# Video files require a different, so we run exiftool 3 times:
# 1. Exclude MOV files and rename the image files with <CreateDate>.
# 2. Target MOV files and rename them with MediaCreateDate (for iPhone videos).
# 3. Target MOV files and rename them with DateTimeOriginal (for Fuji camera videos).

Keybase proof

I hereby claim:

  • I am jmuspratt on github.
  • I am jmuspratt (https://keybase.io/jmuspratt) on keybase.
  • I have a public key whose fingerprint is E6E1 50CF E62F B32B 5EE1 2B37 0441 8CA6 FAD7 7ED5

To claim this, I am signing this object: