Skip to content

Instantly share code, notes, and snippets.

@krishaantechnology
krishaantechnology / tailwind.config.js
Created February 12, 2023 01:25
Tailwind CSS: Shake Animation
const defaultTheme = require('tailwindcss/defaultTheme');
module.exports = {
purge: [
'./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
'./storage/framework/views/*.php',
'./resources/views/**/*.blade.php',
'./resources/js/**/*.vue',
],
@enisdenjo
enisdenjo / graphiql-over-ws.html
Last active December 20, 2023 05:32
GraphiQL ❤️ graphql-ws
<!--
* Copyright (c) 2021 GraphQL Contributors
* All rights reserved.
*
* This code is licensed under the MIT license.
* Use it however you wish.
-->
<!DOCTYPE html>
<html>
<head>
@alloy
alloy / LiveQueryPolyfill.ts
Last active February 24, 2021 15:09
Rewrite GraphQL Live Query to subscription.
/**
* This is a Live Query polyfill, as graphql-js does not strictly have support for that. Instead, we leave it up to the
* client to recognize a Live Query is requested with the `@live` directive on a `query` operation and here we
* transform it into a `live` subscription instead.
*
* Consider a schema like the following:
*
* ```graphql
type Badge {
id: ID!
@benjie
benjie / OneOfExploration.md
Last active December 4, 2023 14:41
Exploring how `oneOf` could work in a GraphQL schema

oneOf exploration

This document is a work-in-progress exploration of how the "oneOf" solution to input polymorphism might work within a GraphQL schema.

Base schema

For the examples below, we'll be using the following shared types using existing GraphQL syntax:

Jest and the --changedSince flag in GitHub Actions

Recently, I've been working a lot more with GitHub Actions - both writing actions and creating CI pipelines for projects.

Last week I picked up a project I started a bit ago: the nodejs/examples repository.

Note: The examples repository is still in early stages. As such, there's still a bunch of WIP work we're doing - we've intentionally not talked a bunch publicly about it yet. That said, if you're interested in helping, feel free to reach out to me on Twitter or the OpenJS Slack ❤️

The goal of this repository is to be home to a bunch of distinct and well-tested examples of real-world Node.js that go beyond "hello, world!". This means there's hopefully going to be a boatload of distinct projects in there.

@bergmannjg
bergmannjg / rearct-native-app-in-wsl2.md
Last active March 14, 2025 23:12
Building a react native app in WSL2
@sibelius
sibelius / Environment.tsx
Last active October 7, 2022 23:07
Debug Relay Store on Chrome DevTools
const env = new Environment({
network,
store,
handlerProvider: RelayDefaultHandlerProvider,
log: isDev ? relayTransactionLogger : null,
});
if (isDev) {
window.relayEnvironment = env;
window.debugRelayStore = () =>
@acutmore
acutmore / README.md
Last active February 27, 2025 19:55
Emulating a 4-Bit Virtual Machine in (TypeScript\JavaScript) (just Types no Script)

A compile-time 4-Bit Virtual Machine implemented in TypeScript's type system. Capable of running a sample 'FizzBuzz' program.

Syntax emits zero JavaScript.

type RESULT = VM<
  [
    ["push", N_1],         // 1
    ["push", False],       // 2
 ["peek", _], // 3
@n1ru4l
n1ru4l / use-reset-State.js
Created August 30, 2019 07:02
useResetState
const NO_VALUE_SYMBOL = Symbol("USE_RESET_STATE_NO_VALUE");
const useResetState = (createValue, deps = []) => {
const [, triggerRerender] = useState(createValue);
const stateRef = useRef(NO_VALUE_SYMBOL);
const depsRef = useRef(deps);
if (stateRef.current === NO_VALUE_SYMBOL) {
stateRef.current = createValue();
}
if (depsRef.current.some((value, index) => value !== deps[index])) {
@sibelius
sibelius / react-scripts+3.0.1.patch
Created July 22, 2019 00:51
react-scripts patch-package to avoid type checking on CRA
diff --git a/node_modules/react-scripts/config/webpack.config.js b/node_modules/react-scripts/config/webpack.config.js
index 8f70442..dfd86d8 100644
--- a/node_modules/react-scripts/config/webpack.config.js
+++ b/node_modules/react-scripts/config/webpack.config.js
@@ -47,6 +47,10 @@ const shouldInlineRuntimeChunk = process.env.INLINE_RUNTIME_CHUNK !== 'false';
// Check if TypeScript is setup
const useTypeScript = fs.existsSync(paths.appTsConfig);
+// Skip TypeScript type checking
+const typeCheckTypeScript =