If you haven't already set your NPM author info, now you should:
npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"
npm adduser
/*! | |
* Dynamically changing favicons with JavaScript | |
* Works in all A-grade browsers except Safari and Internet Explorer | |
* Demo: http://mathiasbynens.be/demo/dynamic-favicons | |
*/ | |
// HTML5™, baby! http://mathiasbynens.be/notes/document-head | |
document.head || (document.head = document.getElementsByTagName('head')[0]); | |
function changeFavicon(src) { |
For a code newbie like myself, callbacks, closures and promises are scary JavaScript concepts.
10 months into my full-time dev career, and I would struggle to explain these words to a peer.
So I decided it was time to face my fears, and try to get my head around each concept.
Here are the notes from my initial reading. I'll continue to refine them as my understanding improves.
// There are other differences between Jest and Mocha, | |
// but these were the functions being used at Airbnb. | |
global.context = describe; | |
global.before = beforeAll; | |
global.after = afterEach; |
<div class="slider"> | |
<button id="previous-button">Previous</button> | |
<div class="item-container selected"></div> | |
<div class="item-container"></div> | |
<div class="item-container"></div> | |
<div class="item-container"></div> | |
<div class="item-container"></div> | |
<button id="next-button">Next</button> | |
</div> | |
</div> |
call plug#begin('~/.vim/plugged') | |
" Syntax and language specific | |
Plug 'tpope/vim-git' | |
Plug 'tasn/vim-tsx' | |
Plug 'vim-ruby/vim-ruby' | |
Plug 'othree/html5.vim' | |
Plug 'othree/jsdoc-syntax.vim' | |
Plug 'othree/javascript-libraries-syntax.vim' | |
Plug 'leshill/vim-json' |
var arraySum = function(array) { | |
var total = 0; | |
if(array.length === 0) { | |
return 0; | |
} | |
var popped = array.pop(); | |
if(Array.isArray(popped)) { | |
total += arraySum(popped); | |
return total += arraySum(array); | |
} |
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
New feature | ✨ :sparkles: |
Bugfix | 🐛 :bug: |
const electron = require('electron') | |
// Module to control application life. | |
const app = electron.app | |
// Module to create native browser window. | |
const BrowserWindow = electron.BrowserWindow | |
const path = require('path') | |
const url = require('url') | |
// Keep a global reference of the window object, if you don't, the window will |