Skip to content

Instantly share code, notes, and snippets.

View corygibbons's full-sized avatar

Cory Gibbons corygibbons

View GitHub Profile
@m5r
m5r / index.tsx
Created February 26, 2022 20:22
bullmq job queue in Remix
import notifierQueue from "~/queues/notifier.server.ts";
export const loader = async () => {
await notifierQueue.add("test", { emailAddress: "mokhtar@remixtape.dev" });
return null;
};
@ChronSyn
ChronSyn / babel.config.js
Last active February 25, 2024 18:31
Expo - Alias path example
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: [
["@babel/plugin-transform-flow-strip-types"],
["@babel/plugin-proposal-decorators", { "legacy": true }],
["@babel/plugin-proposal-class-properties", { "loose": true }],
["module-resolver", {
"alias": {
/*
* This script fetches all color styles from a Figma team/document.
*
* Dependencies:
*
* - node-fetch
*
* Due to a limitation in the Figma /styles endpoint, we need to use a
* document for actually using the colors in a color grid 🙄That's why
* we're both fetching from /styles and /files below.
@rsms
rsms / figma-project-stats.js
Created June 21, 2018 19:17
Script that generates statistics for a Figma project, like number of files, frames, versions etc
//
// Figma project stats
// Pulls statistics like number of files, frames, versions etc for a project.
//
// Usage:
// export FIGMA_API_ACCESS_TOKEN='your-token'
// node figma-project-stats.js <project-id>
//
// You can generate tokens in your account settings or at
// https://www.figma.com/developers/explorer#personal-access-token
@lostfictions
lostfictions / svg-to-css-clip-path-polygon.js
Created January 2, 2018 02:01
convert an svg to a css clip-path polygon
// why do this? clip-path accepts a `url` reference to an svg element, right?
// the difference is that anything defined as a `basic-shape` can be animated:
// https://developer.mozilla.org/en-US/docs/Web/CSS/clip-path
const input = `121.151,20.761 170.165,55.885 200.872,3.816 231.145,55.884 280.592,20.762 286.854,80.687 346.526,68.666
327.657,126.005 387.276,139.247 346.502,184 395.796,220.302 340.127,244.647 370.611,297.814 309.636,297.457 316.076,358.381
260.303,333.3 241.622,391.529 200.655,345.979 160.121,391.53 141.008,333.302 85.666,358.381 91.673,297.456 31.131,297.813
61.183,244.647 5.947,220.302 54.81,184 14.466,139.248 73.652,126.004 55.216,68.667 114.457,80.688 `
const viewBoxScale = 4

Theo lets you preprocess your JSON data before sending it through to its normal processes. This preprocess allows you to use a nested props structure, which is then converted to standard flat props.

props:
  BUTTON:
    BACKGROUND:
      value: blue
    COLOR:
      value: white 
 HOVER:
@tomysmile
tomysmile / mac-setup-redis.md
Last active March 18, 2024 22:12
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@iammerrick
iammerrick / children-as-function.js
Created May 24, 2016 23:41
Which API do you prefer? Passing a function into the Ratio component or making a higher order component called Ratio you can use to configure a component.
<Ratio width={Ratio.OPTIONS.FLUID} x={3} y={4}>
{(width, height) => (
<Chart id={this.props.id} width={width} height={height} />
)}
</Ratio>
@dsdsdsdsdsds
dsdsdsdsdsds / cursor.css
Last active November 1, 2023 11:45
CSS: Cross Browser hires/retina cursor image
.cursor {
cursor: url("cursor.png") 0 0, pointer; /* Legacy */
cursor: url("cursor.svg") 0 0, pointer; /* FF */
cursor: -webkit-image-set(url("cursor.png") 1x, url("cursor@2x.png") 2x) 0 0, pointer; /* Webkit */
}
@squarism
squarism / iterm2.md
Last active April 25, 2024 03:50
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)