View destructure-props.js
This file contains 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 = function (fileInfo, api) { | |
const j = api.jscodeshift; | |
return j(fileInfo.source) | |
.find(j.FunctionDeclaration) | |
.forEach((path) => { | |
const params = path.value.params; | |
if (params.length === 1 && params[0].type === "Identifier" && params[0].name === "props") { | |
const propsParam = params[0]; | |
const propsUsages = j(path).find(j.Identifier, { name: "props" }); |
View change-prop-value.js
This file contains 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
// change-prop-value.js | |
const j = require('jscodeshift'); | |
module.exports = function (fileInfo, api) { | |
const componentName = 'MyComponent'; // Replace with your component name | |
const propName = 'myProp'; // Replace with the prop name you want to change | |
const newValue = 'newValue'; // Replace with the new value for the prop | |
const root = j(fileInfo.source); |
View machine.js
This file contains 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
const fetchMachine = Machine({ | |
id: 'Form Wizard', | |
initial: 'pending', | |
context: { | |
retries: 0 | |
}, | |
states: { | |
pending: { | |
initial: 'email', | |
states: { |
View machine.js
This file contains 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
View machine.js
This file contains 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
const machine = Machine({ | |
id: "fetch", | |
initial: "idle", | |
context: { | |
data: null, | |
error: null, | |
lastRequest: -Infinity | |
}, | |
states: { | |
idle: { |
View machine.js
This file contains 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
View machine.js
This file contains 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
View vivid-tailwind-theme.js
This file contains 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 = { | |
red: { | |
'100': '#FFBDBD', | |
'200': '#FF9B9B', | |
'300': '#F86A6A', | |
'400': '#EF4E4E', | |
'500': '#E12D39', | |
'600': '#CF1124', | |
'700': '#AB091E', | |
'800': '#8A041A', |
View Box.tsx
This file contains 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 styled from "@emotion/styled"; | |
import { shouldForwardProp } from "@styled-system/should-forward-prop"; | |
import { | |
background, | |
border, | |
color, | |
flexbox, | |
grid, | |
layout, | |
position, |
View EdgeDetector.java
This file contains 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
/** | |
* An imagereader that doesn't look at all like the professors + an edge detector. >.> | |
* (in my defense, it's mostly reading the API). | |
* I will use the Sobel's Operator, because I think it's the prettiest and I'm an annoying, pretentious, artist. | |
* Sobel's operator works by using a 3x3 matrix kinda operation to find the abruptness of change in rgb values. | |
* Therefore, my strategy will be to use a for loop to iterate through all the pixels and use this operator on all of them. | |
* Hopefully it works out. | |
*/ | |
import java.awt.Color; |
NewerOlder