Instantly share code, notes, and snippets.

View jscodeshift.md

codemod-cli is straightforward - but it's especially made for codemod projects that have multiple transforms. For a single transform, we could/should have a simpler interface for consumers.

Here are three ways to share your codemod with others. The npx methods require you npm publish the repo.

Method 1 - global install, using githubusercontent

Easiest method for the developer, especially if you only have one transform and/or if you're not using codemod-cli. This uses the github-hosted raw.githubusercontent link to run it, kinda like running it from a gist. Here's an example using ember-mocha-codemods.

npm install -g jscodeshift
View 0 README.md

short url: caseywatts.com/graphviz

Graphviz is like markdown, for diagrams.

It's a tool that can transform text input into a "directed graph" output, which is nodes pointing to other nodes. You can use it for architecture diagrams, DB diagrams, documentation for users, etc.

graphviz-it

You'll want to use a tool with a two-pane layout - the left side is the source text, the right side is the image output.

View bubbles.dot
digraph bubbles {
node [
color=lightcyan2,
style=filled,
fillcolor=lightcyan
]
edge [
color=white
]
View Wassailing&Carols.md

Keys

G C F Bb Eb Ab
1 0 1 2 3 4
F# _ Bb Bb, Eb Bb, Eb, Ab Bb, Eb, Ab, Db
Song Key Starting Note
Gloucestershire Wassail G D (5) -> G (1)
View 0 README.md
View json-pretty-print.js
// app/helpers/json-pretty-print.js
// usage {{json-pretty-print someJson}}
// see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_space_argument
import Helper from '@ember/component/helper';
export default Helper.extend({
compute(params, hash) {
const [json] = params;
return JSON.stringify(json, null, ' ');
View 0 Guidelines.md
View orgchart-search.xml
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>ORG</ShortName>
<Description>Salesforce Org Chart</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">data:text/html;base64,PCFET0NUWVBFIGh0bWw+CjxodG1sPgogIDxoZWFkPgogICAgPHRpdGxlPlNhbGVzZm9yY2UgT3JnQ2hhcnQ8L3RpdGxlPgogICAgPHNjcmlwdCBzcmM9Ii9hc3NldHMvZDMudjMubWluLmpzIj48L3NjcmlwdD4KICAgIDxzY3JpcHQgc3JjPSIvYXNzZXRzL2pxdWVyeS0zLjAuMC5taW4uanMiPjwvc2NyaXB0PgogICAgPHNjcmlwdCBzcmM9Ii9hc3NldHMvbWFnaWNfZHluYW1pYy5qcyI+PC9zY3JpcHQ+CiAgICA8c2NyaXB0PgogICAgICAoZnVuY3Rpb24oaSxzLG8sZyxyLGEsbSl7aVsnR29vZ2xlQW5hbHl0aWNzT2JqZWN0J109cjtpW3JdPWlbcl18fGZ1bmN0aW9uKCl7CiAgICAgIChpW3JdLnE9aVtyXS5xfHxbXSkucHVzaChhcmd1bWVudHMpfSxpW3JdLmw9MSpuZXcgRGF0ZSgpO2E9cy5jcmVhdGVFbGVtZW50KG8pLAogICAgICBtPXMuZ2V0RWxlbWVudHNCeVRhZ05hbWUobylbMF07YS5hc3luYz0xO2Euc3JjPWc7bS5wYXJlbnROb2RlLmluc2VydEJlZm9yZShhLG0pCiAgICAgIH0pKHdpbmRvdyxk
View 0 README.md