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)
javascript:(function() { | |
function copyToClipboard(text) { | |
if (window.clipboardData && window.clipboardData.setData) { | |
/*IE specific code path to prevent textarea being shown while dialog is visible.*/ | |
return clipboardData.setData("Text", text); | |
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) { | |
var textarea = document.createElement("textarea"); | |
textarea.textContent = text; |
import fs from 'fs'; | |
import path from 'path'; | |
const convert = (imgPath) => { | |
// read image file | |
fs.readFile(imgPath, (err, data)=>{ | |
// error handle | |
if(err) { | |
throw err; | |
} |
This is one chapter of my "Chrome Extension Workshops" tutorial, see the rest here: https://gist.github.com/caseywatts/8eec8ff974dee9f3b247
Unrelated update: my book is out! Debugging Your Brain is an applied psychology / self-help book
I'm feeling very clever. I've got this sweet line of javascript that replaces "cloud" with "butt". My mom would LOVE this, but she doesn't computer very well. I'm afraid to show her the Developer Console and have her type/paste this in. But she IS pretty good at bookmarks, she knows just how to click those!
A bookmark normally takes you to a new web page. A bookmarklet is a bookmark that runs javascript on the current page instead of taking you to a new page. To declare that it is a bookmarklet, the "location" it points to starts with javascript:
.
#!/usr/bin/env Rscript | |
# Title : Execute Shiny App | |
# Objective : Initialize Plumber and run Shiny app as "future" (background) worker as defined by local app.R or server.R/ui.R | |
# Created by: John Hall | |
library("future") | |
library("httr") | |
library("httpuv") | |
library("magrittr") | |
library("plumber") | |
library("shiny") |
#Requires -Modules @{ ModuleName = 'PwshSpectreConsole'; RequiredVersion = '2.1.1' } | |
Set-SpectreColors -AccentColor DeepPink1 | |
# Build root layout scaffolding for: | |
# .--------------------------------. | |
# | Title | <- Update-TitleComponent will render the title | |
# |--------------------------------| | |
# | | <- Update-MessageListComponent will display the list of messages here | |
# | | |
<# | |
.SYNOPSIS | |
PUT SHORT SCRIPT DESCRIPTION HERE AND ADD ANY ADDITIONAL KEYWORD SECTIONS AS NEEDED (.PARAMETER, .EXAMPLE, ETC.). | |
#> | |
[CmdletBinding()] | |
param ( | |
# PUT PARAMETER DEFINITIONS HERE AND DELETE THIS COMMENT. | |
) | |
process { |
function Invoke-ScriptBlockWithRetries { | |
[CmdletBinding(DefaultParameterSetName = 'RetryNonTerminatingErrors')] | |
param ( | |
[Parameter(Mandatory = $true, HelpMessage = "The script block to execute.")] | |
[ValidateNotNull()] | |
[scriptblock] $ScriptBlock, | |
[Parameter(Mandatory = $false, HelpMessage = "The maximum number of times to attempt the script block when it returns an error.")] | |
[ValidateRange(1, [int]::MaxValue)] | |
[int] $MaxNumberOfAttempts = 5, |
.PHONY: buildsite check clean coverage docs getwd initialize install load render setwd start test usegit | |
.DEFAULT_GOAL := help | |
define BROWSER_PYSCRIPT | |
import os, webbrowser, sys | |
from urllib.request import pathname2url | |
# The input is expected to be the full HTML filename | |
filename = sys.argv[1] | |
filepath = os.path.abspath(os.path.join("./vignettes/", filename)) |