Skip to content

Instantly share code, notes, and snippets.

Avatar

Tim Hobbs timhobbs

View GitHub Profile
@timhobbs
timhobbs / gist:4d2751b1cbe6d9498692465a40cc9c77
Created Mar 13, 2019 — forked from vladimirtsyupko/gist:10964772
Git force pull to overwrite local files
View gist:4d2751b1cbe6d9498692465a40cc9c77
git fetch --all
git reset --hard origin/master
git pull origin master
View git-tag-delete-local-and-remote.sh
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@timhobbs
timhobbs / camelCase.js
Created Jun 6, 2018 — forked from johnsmith17th/camelCase.js
To convert string to camel case in javascript.
View camelCase.js
function toCamelCase(string) {
string = string.toLowerCase().replace(/(?:(^.)|([-_\s]+.))/g, function(match) {
return match.charAt(match.length-1).toUpperCase();
});
return string.charAt(0).toLowerCase() + string.substring(1);
}
View colorbox.less
@import "variables.less";
@import "mixins.less";
@import "buttons.less";
@import "modals.less";
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:10001; overflow:hidden;}
#cboxOverlay{position:fixed; width:100%; height:100%;}
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
#cboxContent{position:relative;}
#cboxLoadedContent{overflow:auto;}
@timhobbs
timhobbs / Adapter.js
Created Oct 16, 2012 — forked from michaeljacobdavis/Adapter.js
NotEqual Fluent Validation validator with client side validation
View Adapter.js
(function ($) {
$.validator.addMethod("notequal", function (value, element, param) {
if (param.indexOf("#") == -1) return value != param;
return value != $(param).val();
}, $.validator.messages.notequal);
$.validator.unobtrusive.adapters.add("notequal", ["field"], function (options) {
options.rules["notequal"] = options.params.field;
if (options.message) options.messages["notequal"] = options.message;
});
You can’t perform that action at this time.