This file contains 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
# Install NVM manually (https://github.com/creationix/nvm) | |
# Install bass (https://github.com/edc/bass) | |
# Add code below to your config.fish | |
function nvm | |
bass source ~/.nvm/nvm.sh --no-use ';' nvm $argv | |
end | |
nvm use default --silent |
This file contains 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
// This script will help you to endorse all skills w/o manual clicking on each | |
// Open target LinkedIn profile and paste code below in browser's console | |
Array.from(document.querySelectorAll('.pv-skill-entity__featured-endorse-button-shared')).filter(e => e.ariaPressed === 'false').forEach(e => e.click()) |
This file contains 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
function tryCatch (/* fn, context, arguments */) { | |
var args = Array.prototype.slice.call(arguments); | |
var fn = args[0]; | |
var context = args[1]; | |
args = args.slice(2, args.length); | |
try { | |
fn.apply(context, args); | |
} catch (e) { |
This file contains 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 path = require('path'); | |
module.exports = (function () { | |
return path.dirname(require.main.filename || process.mainModule.filename); | |
})(); | |
// Example of usage: | |
var root = require('root'); // In root will be absolute path to your application |
This file contains 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 parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
This file contains 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
EXAMPLE OF FULL-FETURED COMMIT MESSAGE: | |
================================================================================ | |
EMKT-0000: Summarize changes in around 50 characters or less | <-- COMMIT SUBJECT | |
More detailed explanatory text, if necessary. Wrap it to about 72 | | |
characters or so. In some contexts, the first line is treated as the | | |
subject of the commit and the rest of the text as the body. The blank | | |
line separating the summary from the body is critical (unless you omit | | |
the body entirely); various tools like `log`, `shortlog` and `rebase` | |
This file contains 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
;(function () { | |
var options = { | |
name: 'logger', | |
label: '❤', | |
date: true, | |
color: '#2980b9' | |
}; | |
window[options.name] = function () { | |
var label = options.label + (options.date ? ('[' + Date() + ']') : '') | |
, _arg = []; |
This file contains 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 userCatched = 0; | |
var handler = function (e) { | |
if (!userCatched) { | |
userCatched = !0; | |
console.log('You\'re catched!'); | |
} else { | |
document.removeEventListener(e.type, arguments.callee); | |
} | |
} |
This file contains 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
// A list of possible usernames to reserve to avoid | |
// vanity URL collision with resource paths | |
// It is a merged list of the recommendations from this Quora discussion: | |
// http://www.quora.com/How-do-sites-prevent-vanity-URLs-from-colliding-with-future-features | |
// Country TLDs found here: | |
// http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains//Country_code_top-level_domains | |
// Languages found here: |
This file contains 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
// Generate @font-face | |
// | |
// $font-base-path {String} - path to fonts directory relative to CSS location | |
// $font-family {String} - font-family (w/o spaces) | |
// $font-weight {Number} - font-weight | |
// $font-style {String} - font-style (default: normal) | |
// | |
// File path & file name are based on font props which we include. | |
// Examples of path mapping: | |
// @include font-face("../../fonts/", "open-sans", 300); => ../../fonts/open-sans/300/open-sans-300.* |
NewerOlder