This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Exclude all node modules except hex-rgb and another-package | |
/node_modules\/(?![hex\-rgb|another\-package])/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
############################################# | |
# Some public functions in Open Bitbucket Cloud, Bitbucket Server or Github repo quickly: | |
# - git_create_pr | |
# - git_open_repo | |
# - git_view_current_commit_in_web | |
############################################# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// bad | |
function anAsyncCall() { | |
var promise = doSomethingAsync(); | |
promise.then(function() { | |
somethingComplicated(); | |
}); | |
return promise; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>com.atlassian.maven.plugins</groupId> | |
<artifactId>maven-***-plugin</artifactId> <!-- *** is the name of the application (product) you're using --> | |
<version>3.2.3</version> | |
<extensions>true</extensions> | |
<configuration> | |
<productVersion>${product.version}</productVersion> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var selectFromElementToElement = function(startSelection, endSelection) { | |
rng = dom.createRng(); | |
rng.setStartBefore(startSelection); | |
rng.setEndAfter(endSelection); | |
sel.setRng(rng); | |
ed.nodeChanged(); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# check if a directory exists in a shell script you can use the following: | |
if [ -d "$DIRECTORY" ]; then | |
# Control will enter here if $DIRECTORY exists. | |
fi | |
#Or to check if a directory doesn't exist: | |
if [ ! -d "$DIRECTORY" ]; then | |
# Control will enter here if $DIRECTORY doesn't exist. | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Ref: http://www.paulirish.com/2009/throttled-smartresize-jquery-event-handler/ | |
(function($,sr){ | |
// debouncing function from John Hann | |
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/ | |
var debounce = function (func, threshold, execAsap) { | |
var timeout; | |
return function debounced () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Listen for orientation changes | |
window.addEventListener("orientationchange", function() { | |
// Announce the new orientation number | |
console.log(window.orientation); | |
// 0 means portrait, 90 means landscape rotated to the left, -90 means landscape rotated to the right | |
}, false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Include template | |
get_template_part('/partials/footer/globalFooterScript'); | |
2. Get link of cat by cat name | |
<?php echo get_category_link( get_cat_ID( 'liên hệ' ) ) ?> |