Skip to content

Instantly share code, notes, and snippets.

View ducdhm's full-sized avatar
:electron:
Keep Moving Forward

Duc Doan (Bobby) ducdhm

:electron:
Keep Moving Forward
  • Ha Noi, Vietnam
View GitHub Profile
/*!
* jQuery TextChange Plugin
* http://www.zurb.com/playground/jquery-text-change-custom-event
*
* Copyright 2010, ZURB
* Released under the MIT License
*/
(function ($) {
$.event.special.textchange = {
@lancejpollard
lancejpollard / meta-tags.md
Created March 5, 2012 13:54
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
var redirectTo = function (url) {
var anchor = document.createElement('a');
anchor.href = url;
document.body.appendChild(anchor);
anchor.click();
};
redirectTo('http://coccoc.com');
@mrchief
mrchief / LICENSE.md
Last active March 23, 2024 12:28
Add "Open with Sublime Text 2" to Windows Explorer Context Menu (including folders)

MIT License

Copyright (c) [year] [fullname]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@branneman
branneman / call-apply-bind-proxy.js
Last active February 22, 2024 21:06
JavaScript call() vs apply() vs bind() vs $.proxy()
var fn = function(arg1, arg2) {
var str = '<p>aap ' + this.noot + ' ' + arg1 + ' ' + arg2 + '</p>';
document.body.innerHTML += str;
};
var context = {
'noot': 'noot'
};
var args = ['mies', 'wim'];
// Calls a function with a given 'this' value and arguments provided individually.
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active July 2, 2024 00:02
how to delete a git tag locally and remote
# 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
@jcppkkk
jcppkkk / OpenWithSublime.bat
Last active June 25, 2023 22:07 — forked from FoxColdMetal/OpenWithSublimeText.bat
[[[ Move to https://github.com/jcppkkk/OpenWithSublime !!! ]]] Add context menu to allow user open file or folder with Sublime as User (or as Admin).
@echo off
:: Path to Sublime Text installation dir.
SET stPath=%~dp0sublime_text.exe
SET stPathOnly=%~dp0
:: Key name for the registry entries.
SET UserEntry=Sublime Text
SET AdminEntry=Sublime Text As Admin
:: Context menu texts.
SET "UserMenuText=Open with Sublime(&-)"
SET "AdminMenuText=Open with Sublime As Admin(&+)"
@ducdhm
ducdhm / addNumber.js
Last active September 27, 2016 03:19
Add multiple floats as well as numbers
/**
* Bob Math utilities
* @author: ducdhm
* @created: Tue, Feb 11th, 2014 (GTM+7)
*/
(function(Math) {
/**
* Find the number of decimal places
* @method findDec
* @param {Float|Number} dec
@ducdhm
ducdhm / example.js
Last active August 29, 2015 13:56
Get value when press key down with keydown2
$('#query').keydown2(function () {
console.log($(this).val());
});
@ducdhm
ducdhm / generatePasswordRegex.js
Last active August 29, 2015 13:59
Generate password regexp for validating purpose
/**
* Generate password regex
* @method generatePasswordRegex
* @param {Number} min Minimum length of password
* @param {Number} max Maximum length of password
* @param {String} specialCharacter List of special characters
* @param {Number} specialLength Number of required special character in password
* @param {Number} uppercaseLength Number of required uppercase character in password
* @param {Number} numberLength Number of digit character in password *
*/