Skip to content

Instantly share code, notes, and snippets.

Daniel Griffin dsgriffin

View GitHub Profile
@dsgriffin
dsgriffin / git-filename-capitalisation
Created Jan 26, 2016
Simple way to change capitalisation of files/folders using Git.
View git-filename-capitalisation
git mv -f filename FileName
@dsgriffin
dsgriffin / audioAutoplay.js
Created Jan 19, 2016
Detect Audio autoplay ability (isn't available via. Modernizr and could be useful for Mobile Browsers)
View audioAutoplay.js
var AUTOPLAY = false; // A flag to be used in the anonymous function
(function() {
// Audio file data URIs; MP3 + OGG
var mp3 = 'data:audio/mpeg;base64,/+MYxAAAAANIAUAAAASEEB/jwOFM/0MM/90b/+RhST//w4NFwOjf///PZu////9lns5GFDv//l9GlUIEEIAAAgIg8Ir/JGq3/+MYxDsLIj5QMYcoAP0dv9HIjUcH//yYSg+CIbkGP//8w0bLVjUP///3Z0x5QCAv/yLjwtGKTEFNRTMuOTeqqqqqqqqqqqqq/+MYxEkNmdJkUYc4AKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq';
var ogg = 'data:audio/ogg;base64,T2dnUwACAAAAAAAAAADqnjMlAAAAAOyyzPIBHgF2b3JiaXMAAAAAAUAfAABAHwAAQB8AAEAfAACZAU9nZ1MAAAAAAAAAAAAA6p4zJQEAAAANJGeqCj3//////////5ADdm9yYmlzLQAAAFhpcGguT3JnIGxpYlZvcmJpcyBJIDIwMTAxMTAxIChTY2hhdWZlbnVnZ2V0KQAAAAABBXZvcmJpcw9CQ1YBAAABAAxSFCElGVNKYwiVUlIpBR1jUFtHHWPUOUYhZBBTiEkZpXtPKpVYSsgRUlgpRR1TTFNJlVKWKUUdYxRTSCFT1jFloXMUS4ZJCSVsTa50FkvomWOWMUYdY85aSp1j1jFFHWNSUkmhcxg6ZiVkFDpGxehifDA6laJCKL7H3lLpLYWKW4q91xpT6y2EGEtpwQhhc+211dxKasUYY4wxxsXiUyiC0JBVAAABAABABAFCQ1YBAAoAAMJQDEVRgNCQVQBABgCAABRFcRTHcRxHkiTLAkJDVgEAQAAAAgAAKI7hKJIjSZJkWZZ
@dsgriffin
dsgriffin / jQueryUI_tabState
Created May 29, 2015
A simple way to remember the active tab after a page refresh.
View jQueryUI_tabState
$("#tabs").tabs({
active: localStorage.getItem("activeTab"),
activate: function(event, ui) {
localStorage.setItem("activeTab", $(this).tabs('option', 'active'));
}
});
You can’t perform that action at this time.