To create an anchor to a heading in github flavored markdown.
Add - characters between each word in the heading and wrap the value in parens (#some-markdown-heading)
so your link should look like so:
[create an anchor](#anchors-in-markdown)
(defn get-clipboard [] | |
(.getSystemClipboard (java.awt.Toolkit/getDefaultToolkit))) | |
(defn slurp-clipboard [] | |
(try | |
(.getTransferData (.getContents (get-clipboard) nil) (java.awt.datatransfer.DataFlavor/stringFlavor)) | |
(catch java.lang.NullPointerException e nil))) | |
(defn spit-clipboard [text] | |
(.setContents (get-clipboard) (java.awt.datatransfer.StringSelection. text) nil)) |
While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.
Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.
lib/
is intended for code that can run as-issrc/
is intended for code that needs to be manipulated before it can be usedfunction camelCaseToDash( myStr ) { | |
return myStr.replace( /([a-z])([A-Z])/g, '$1-$2' ).toLowerCase(); | |
} | |
var myStr = camelCaseToDash( 'thisString' ); | |
alert( myStr ); // => this-string |
# Version key/value should be on his own line | |
PACKAGE_VERSION=$(cat package.json \ | |
| grep version \ | |
| head -1 \ | |
| awk -F: '{ print $2 }' \ | |
| sed 's/[",]//g' \ | |
| tr -d '[[:space:]]') | |
echo $PACKAGE_VERSION |
chrome.runtime.onMessageExternal.addListener(function(request, sender, sendResponse) { | |
console.log('incomming'); | |
if (request.getTargetData){ | |
console.log('We have target data'); | |
sendResponse({targetData: {}}); | |
} else { | |
if (request.activateLasers) { | |
var success = true; | |
console.log('lazers active'); | |
sendResponse({activateLasers: success}); |
const admin = require('firebase-admin'); | |
function buildHtmlWithPost (post) { | |
const title = post.title + ' | Example Website'; | |
var head = { | |
title: title, | |
meta: [ | |
// This may not be a valid combination of tags for the services you need to support; |
function logColor(color, args) { | |
console.log(`%c ${args.join(' ')}`, `color: ${color}`); | |
} | |
const log = { | |
aliceblue: (...args) => { logColor('aliceblue', args)}, | |
antiquewhite: (...args) => { logColor('antiquewhite', args)}, | |
aqua: (...args) => { logColor('aqua', args)}, | |
aquamarine: (...args) => { logColor('aquamarine', args)}, | |
azure: (...args) => { logColor('azure', args)}, |
const moo = require('moo') | |
function compileClass(constructor, indent) { | |
let s = '' | |
s += indent + 'var ' + constructor.name + ' = ' + constructor | |
for (let key in constructor.prototype) { | |
s += '\n\n' | |
const value = constructor.prototype[key] | |
if (typeof value === 'function') { | |
s += indent + constructor.name + '.prototype.' + key + ' = ' + value |
# normal brew nvm shell config lines minus the 2nd one | |
# lazy loading the bash completions does not save us meaningful shell startup time, so we won't do it | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "/usr/local/opt/nvm/etc/bash_completion" ] && . "/usr/local/opt/nvm/etc/bash_completion" # This loads nvm bash_completion | |
# add our default nvm node (`nvm alias default 10.16.0`) to path without loading nvm | |
export PATH="$NVM_DIR/versions/node/v$(<$NVM_DIR/alias/default)/bin:$PATH" | |
# alias `nvm` to this one liner lazy load of the normal nvm script | |
alias nvm="unalias nvm; [ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh"; nvm $@" |