Skip to content

Instantly share code, notes, and snippets.

@ItsWendell
ItsWendell / action.yaml
Last active November 19, 2023 17:23
Turbo Summarize Github Actions Action
name: "Summarize Turborepo Output"
description: "Summarize Turborepo output for GitHub Actions"
runs:
using: "composite"
steps:
- shell: bash
name: "Summarize Turborepo Output"
run: |
latest_json=$(ls -t .turbo/runs/*.json | head -1)
@andilabs
andilabs / ikea_idasen_custom_top.ipynb
Last active November 7, 2024 09:44
ikea_idasen_custom_top.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@NigelEarle
NigelEarle / Knex-Migrations-Seeding.md
Last active October 31, 2024 18:18
Migration and seeding instructions using Knex.js!

Migrations & Seeding

What are migrations??

Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex command line tool.

To learn more about migrations, check out this article on the different types of database migrations!

Creating/Dropping Tables

@mdo
mdo / 00-intro.md
Last active November 15, 2024 14:13
Instructions for how to affix an Ikea Gerton table top to the Ikea Bekant sit-stand desk frame.

Ikea Bekant standing desk with Gerton table top

@martinbean
martinbean / convert-seconds.js
Created July 13, 2016 08:03
Convert seconds to HH:MM:SS format in JavaScript.
new Date(seconds * 1000).toISOString().substr(11, 8)
@danieleggert
danieleggert / GPG and git on macOS.md
Last active October 27, 2024 11:07
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@brunotavares
brunotavares / react-native-double-tap.js
Last active June 4, 2022 17:14
Double tap gesture recognition for React Native.
const DOUBLE_PRESS_DELAY = 300;
// ...
/**
* Double Press recognition
* @param {Event} e
*/
handleImagePress(e) {
const now = new Date().getTime();
@kashifrazzaqui
kashifrazzaqui / code_review_checklist.txt
Last active February 17, 2024 23:05
Code Review Checklist
- General
[ ] The code works
[ ] The code is easy to understand
[ ] Follows coding conventions
[ ] Names are simple and if possible short
[ ] Names are spelt correctly
[ ] Names contain units where applicable
[ ] Enums are used instead of int constants where applicable
[ ] There are no usages of 'magic numbers'
[ ] All variables are in the smallest scope possible
@sebmarkbage
sebmarkbage / Enhance.js
Last active November 7, 2024 13:05
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.