Skip to content

Instantly share code, notes, and snippets.

View maxxcrawford's full-sized avatar

Maxx Crawford maxxcrawford

View GitHub Profile
@mislav
mislav / gh-rename-master
Last active April 24, 2022 10:02
Rename the default branch of a repository using GitHub CLI https://github.com/cli/cli/releases/tag/v0.10.0
#!/bin/bash
# Usage: gh-rename-master <newbranch> [<remote>]
#
# Renames the "master" branch of the current repository both locally and on GitHub.
#
# dependencies: GitHub CLI v0.10
set -e
newbranch="${1?}"
remote="${2:-origin}"
@peterdemartini
peterdemartini / command.sh
Last active March 28, 2024 17:49
Exclude node_modules in timemachine
find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@dustintheweb
dustintheweb / modernizr-cdn-fallback.js
Last active August 29, 2015 14:01
Modernizr load CDN script with local fallback
Modernizr.load([{
load: [
'//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'
],
complete: function() {
if (!window.jQuery) {
console.log('## CDN Failed - Loading local version of jQuery.');
Modernizr.load('/js/jquery.min.js');
};
}
@dustintheweb
dustintheweb / convert-svg-png
Created May 1, 2014 21:05
Batch Convert SVG to PNG (transparent/ alpha) using ImageMagick
// ImageMagick - Convert SVG to PNG w/ transparency
//
// - open terminal
//
// - confirm you have imagemagick installed
// --- type: convert -v
//
// - cd to folder
//
// - single file
@joyrexus
joyrexus / README.md
Last active February 19, 2024 17:15 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@dustintheweb
dustintheweb / stock-android-browser-check.js
Created July 8, 2013 22:03
Check if the browser user agent is the stock android browser.
// Stock Android Browser Check >>>>>>>>>>>>>>>>
var ua = navigator.userAgent.toLowerCase();
var isAndroid = ua.indexOf("android") > -1 && ua.indexOf("mobile") && ua.indexOf("chrome")==-1
if(isAndroid) {
// stuff
}
@michaelBenin
michaelBenin / Grunt Convert Video FFMPEG
Created June 19, 2013 14:58
Grunt task to convert Video to HTML5 Formats.
/*
convertVideo_config: {
ffmpeg: 'bin/ffmpeg/./ffmpeg',
mp4: '-vcodec libx264',
m4v: '-vcodec libx264',
'3gp': '-acodec libvo_aacenc -vcodec libx264',
webm: '-acodec libvorbis -vcodec libvpx',
ogv: '-acodec libvorbis'
},
@egid
egid / progressive-template.html
Last active November 14, 2023 14:28
Forking the toggled progressive disclosure template found at the Campaign Monitor 2-column layout (originally at http://www.campaignmonitor.com/guides/mobile/responsive/)
<!--
Progressive Disclosure Demo - Updated 15 August, 2012 by Ros
Thank you for taking a look under the hood of our progressive disclosure demo. Please note that this is a work in progress, so it's a tad messy and bound to change.
If you have any questions, feel free to pop a line to support@campaignmonitor.com - we might learn something, too!
Known bugs
----------
@cazepeda-zz
cazepeda-zz / window.location.href
Created October 28, 2012 02:02
Bookmarklet to append a string to the end of a URL
window.location.href
====================
Bookmarklet to append a string to the end of the URL.
1. Create bookmark.
2. Edit bookmark URL(Chrome) / Location(Firefox) to include this code: javascript:window.location.href=window.location.href+'REPLACETHIS';
3. Now make use of that bookmarklet.