Format | Demonstration |
---|---|
JPG | ![]() |
PNG | ![]() |
SVG |
This file contains hidden or 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
mkdir -p webp-90 | |
for filepath in *.jpg; do | |
filename=$(basename "$filepath" .jpg) | |
cwebp -q 90 "$filepath" -o "webp-90/$filename.webp" | |
echo "Converted $filepath to webp-90/$filename.webp" | |
done |
This file contains hidden or 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
import React, { useEffect, useRef } from 'react'; | |
const AnimatedBackground = () => { | |
const canvasRef = useRef(null); | |
useEffect(() => { | |
const canvas = canvasRef.current; | |
const ctx = canvas.getContext('2d'); | |
canvas.width = window.innerWidth; |
This file contains hidden or 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
// NOTE(cvogt): parses documents from the FEC registered candidates table | |
// located at https://www.fec.gov/data/candidates/?election_year=2020&office=P | |
const csvToJson = require('csvtojson/v2'); | |
const candidatesFile = './candidates-running-2016-2019-12-09T23_23_05.csv'; | |
const bracketsStringToArray = str => { | |
// HACK(cvogt): this can be optimized, and is fragile – throws upon {00,00} | |
const itemJsonString = str.replace('{', '[').replace('}', ']'); | |
const items = JSON.parse(itemJsonString); |
This file contains hidden or 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
query { | |
user(login: "${username}") { | |
pullRequests( | |
last: ${maxRepos}, | |
orderBy: { | |
direction: ASC, | |
field: CREATED_AT | |
} | |
) { | |
nodes { |
Current version: 0.2 Package: https://www.npmjs.com/package/xml2js Documentation: https://github.com/Leonidas-from-XIV/node-xml2js
The XML parser can be configured to do many, if not all, of the transformations needed to format the JSON response data as I'd like.
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<GoodreadsResponse> | |
<Request> | |
<authentication>true</authentication> | |
<key><![CDATA[iP2G9OyqjQGvBv4xAzn2DQ]]></key> | |
<method><![CDATA[review_list]]></method> | |
</Request> | |
<books start="1" end="20" total="116" numpages="6" currentpage="1"> | |
<book> |
This file contains hidden or 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
module.exports = { | |
apps: [{ | |
name: 'js-personal-api', | |
script: 'npm', | |
args: 'start', | |
env: { | |
NODE_ENV: 'dev', | |
}, | |
env_production: { | |
NODE_ENV: 'production', |
This file contains hidden or 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
{ | |
"link": "https://www.history.com/topics/holidays/july-4th", | |
"message": "", | |
"items": [ | |
{ | |
"link": "https://www.history.com/topics/holidays/july-4th", | |
"image": "https://onlinestore.wsimg.com/id4/id4-free.png" | |
}, | |
{ | |
"link": "https://www.history.com/topics/holidays/july-4th", |
NewerOlder