Converts components using the legacy Component.extend
syntax to styled(Component)
.
Adds or modifies the styled-components
import as needed.
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
#!/usr/bin/env node | |
// NOTE: I forgot to have it traverse dependencies as well as dev dependencies. | |
// Really, it should check both if we're going to have a clean set of peer dependencies for a published package. | |
const { getPackages } = require('@manypkg/get-packages') | |
const process = require('node:process') | |
const path = require('node:path') | |
const ROOT_DIR = process.cwd() |
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
git diff packages/*/CHANGELOG.md | grep -E '^( ?# |\+[^+])' | cut -c 2- | sed 's/^\(#.*\)$/\1\n/' | pbcopy |
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
// from Egghead video: https://egghead.io/lessons/javascript-handle-branching-logic-with-ramda-s-conditional-functions | |
import * as R from 'ramda' | |
const products = [ | |
{ name: 'Jeans', price: 80, category: 'clothes' }, | |
{ name: 'Cards', price: 5, category: 'games' }, | |
{ name: 'iPhone', price: 649, category: 'electronics' }, | |
{ name: 'Freakonomics', price: 30, category: 'books' }, | |
] |
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
#!/usr/bin/env node | |
const glob = require('glob') | |
const { bold, cyan, gray, italic, magenta } = require('kleur') | |
const cwd = process.argv[2] || process.cwd() | |
const toPercentage = (numerator, denominator) => denominator > 0 ? ((numerator / denominator) * 100) : 0 | |
const stats = Object.entries({ | |
ALL: '**/*.{js,tsx}', |
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
// Just a couple of examples from the crypto-js README. | |
// run with `node bundle.js` after running the rollup build. | |
import CryptoJS from 'crypto-js'; | |
import SHA256 from 'crypto-js/sha256'; | |
console.log(CryptoJS.HmacSHA1('Message', 'Key')); | |
console.log(SHA256('Message')); | |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
<style> | |
html, body { | |
height: 100vh; | |
display: flex; | |
flex-direction: column; |
A Pen by Jeremy Lund on CodePen.
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
<div ng-app="demo" ng-controller="Demo as vm"> | |
<form name="example"> | |
<div> | |
<label>Your name: | |
<input type="text" name="name" ng-model="vm.name" required/> | |
<span ng-show="example.name.$invalid">invalid!</span> | |
</label> | |
</div> | |
<div>Name your three favorite ice cream flavors:</div> | |
<ul> |