Skip to content

Instantly share code, notes, and snippets.

View jccr's full-sized avatar
🔮
Cooking up some magic

Juan Carlos Corona Romero jccr

🔮
Cooking up some magic
View GitHub Profile
@inxilpro
inxilpro / README.md
Created July 22, 2022 21:01
Fully namespaced Tailwind config for widget or embeddable component

Sometimes you need to publish a CSS file for 3rd-party consumption (i.e. default styles for an embeddable JS widget). This set up lets you continue to use Tailwind, but scope all your styles to a specific selector.

Simply replace .internachi with your own widget namespace, set up Tailwind as you please, and run generate.sh to build a custom version of your Tailwind styles that won't interfere with other CSS rules (including the Tailwind reset).

@Tycholiz
Tycholiz / payment-flow-user-stories.md
Last active August 11, 2021 16:11
Postgres user stories for Payment Flows

This file contains snippets of code that you can execute in a postgres client in order to carry out certain user stories at the database-level

Running the below commands assumes that you have taken the 2 steps (in order):

  1. seed the database
  2. run latest database migrations (ie. the ones provided by the db--payment_model_changes branch of the Legible Monorepo)

Purchase a book

-- user signals intent to buy
begin;
@osartun
osartun / coderPadTSTestUtils.ts
Last active March 22, 2024 22:46
Test utilities for TypeScript pads on CoderPad
/**
* You want to use mocha in a TypeScript CoderPad but you get the error
* message that `describe` isn't defined even though you're already using
* the `mocha.suite.emit('pre-require', this, 'solution', mocha)` hack?
*
* > Cannot find name 'describe'. Do you need to install type definitions
* > for a test runner? Try `npm i --save-dev @types/jest` or
* > `npm i --save-dev @types/mocha`.
*
* Here are a couple of lines to copy & paste into your pad to use
@jb-alvarado
jb-alvarado / pci-passthrough.md
Last active October 27, 2023 02:16
PCI Passthrough on Fedora 31

PCI Passthrough

Hardware:

  • Mainboard ASUS PRIME Z390-A Z390
  • ASUS Dual-GTX1650-O4G
  • Intel i9 9900
  • 32GB Ram
  • NEC Corporation uPD720200 USB 3.0 Host Controller
  • Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981/PM983 (1 TB)
@kode54
kode54 / pci_dev_reset.patch
Last active July 26, 2020 17:43
Linux 5.x PCI device detach/attach reset fix for AMD, possibly others; mirrored from https://clbin.com/VCiYJ; see: https://forum.level1techs.com/t/encountering-the-amd-reset-bug-any-fixes-rx-590/143850 - note, I did not author this patch
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 766f5779db92..dc19079dad1b 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -52,6 +52,9 @@ unsigned int pci_pm_d3_delay;
static void pci_pme_list_scan(struct work_struct *work);
+static void pci_dev_save_and_disable(struct pci_dev *dev);
+static void pci_dev_restore(struct pci_dev *dev);
@graynorton
graynorton / jank.js
Created November 13, 2018 23:42
A little wrapper function for detecting and displaying jank. Hacked together for a demo, may not be suitable for any legitimate purpose. :-)
const revealJank = (fn) => {
// jank is a master on/off switch from outer scope
if (!jank) return fn();
// scrim is visible when .janking is on body
document.body.classList.add('janking');
setTimeout(() => {
fn();
let lastFrame = window.performance.now();
let goodFrames = 0;
@jujhars13
jujhars13 / sftp.yaml
Last active March 7, 2024 00:16
kubernetes pod example for atmoz/sftp
apiVersion: v1
kind: Namespace
metadata:
name: sftp
---
kind: Service
apiVersion: v1
metadata:
@davide-romanini
davide-romanini / zipfileremote.py
Last active February 8, 2022 05:16
Python zip file working on remote files over http
"""
Read ZIP files over sliceable objects. This is a modified version
of the original python zipfile implementation.
The main use case is to provide an efficient way to read
even large zip files over remote sites allowing for RANGE
queries.
This work has been ispired by the pinch project
https://github.com/peterhellberg/pinch
@jamtur01
jamtur01 / ladder.md
Last active April 28, 2024 20:07
Kickstarter Engineering Ladder
@tracker1
tracker1 / 01-directory-structure.md
Last active May 4, 2024 19:55
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used