Skip to content

Instantly share code, notes, and snippets.

View kohlmannj's full-sized avatar

Joseph Kohlmann kohlmannj

View GitHub Profile
@Rich-Harris
Rich-Harris / README.md
Last active July 17, 2020 07:09
Svelte style properties naive implementation

This is a copy of an early attempt to imagine an implementation of 'style properties' in Svelte, as described in this RFC. It is preserved here to satisfy curiosity, or in case we hate the new one.


Style properties — handily distinguishable from regular properties by the leading -- used by CSS custom properties — are passed down to components through a separate channel. The example at the top of this RFC might be converted to the following JavaScript:

const slider = new Slider({
  props: {
    value: ctx.value,
@adyontech
adyontech / react-dynamic-import.md
Last active June 28, 2021 17:57
A simple trick to dynamically import components in react.

AsyncLoadFile.jsx

import React, { Component } from 'react';

export default function asyncComponent(importComponent) {
    class AsyncComponent extends Component {
        /**
        * @constructor
        * @desc Represents AsyncComponent component
        * @param props Properties passed from parent component
.evaluateTypeof()
.evaluate()
.evaluateIdentifier()
.evaluateDefinedIdentifier()
.evaluateCallExpressionMember()
.statement(statement)
.statementIf(statement)
.label()
.import(statement,source)
.importSpecifier(statement,source,exportName,identifierName)
@iaincollins
iaincollins / adr_template.md
Last active September 20, 2021 14:26
ADR Template

[short title of solved problem and solution]

  • Status: [accepted | superseded by ADR-0005 | deprecated | …]
  • Deciders: [list everyone involved in the decision]
  • Date: [YYYY-MM-DD when the decision was last updated]

Technical Story: [description | ticket/issue URL]

Context and Problem Statement

@diuis
diuis / gist:fc1c2f0e255538cda397c5a6b669c9bf
Created October 5, 2018 13:24
react video element iOS autoplay
import * as React from "react";
import { Container, Row, Col } from 'reactstrap';
import '../styles/video-react.css'
export interface ApplicationProps { url: string; }
export class Application extends React.Component<ApplicationProps, {}> {
private videoNode: HTMLVideoElement;
@mchow01
mchow01 / cyber_security_skills_shortage.md
Last active January 18, 2025 20:18
How long we have been playing this "cyber security skills shortage" game for?
@bvaughn
bvaughn / index.md
Last active April 17, 2025 15:47
How to use profiling in production mode for react-dom

React recently introduced an experimental profiler API. This page gives instructions on how to use this API in a production release of your app.

Table of Contents

Profiling in production

React DOM automatically supports profiling in development mode for v16.5+, but since profiling adds some small additional overhead it is opt-in for production mode. This gist explains how to opt-in.

@bvaughn
bvaughn / index.md
Last active February 25, 2025 15:56
Interaction tracing with React

This API was removed in React 17


Interaction tracing with React

React recently introduced an experimental profiler API. After discussing this API with several teams at Facebook, one common piece of feedback was that the performance information would be more useful if it could be associated with the events that caused the application to render (e.g. button click, XHR response). Tracing these events (or "interactions") would enable more powerful tooling to be built around the timing information, capable of answering questions like "What caused this really slow commit?" or "How long does it typically take for this interaction to update the DOM?".

With version 16.4.3, React added experimental support for this tracing by way of a new NPM package, scheduler. However the public API for this package is not yet finalized and will likely change with upcoming minor releases, so it should be used with caution.

@matux
matux / scntool.md
Last active April 11, 2023 13:49
SceneKit scntool command line options
$ xcrun scntool --verbose
| Current SceneKit version is 4.560000
| Running scntool (compiled on Jul  1 2018 01:01:55)

usage: scntool --convert file --format format [--output file]
000084a8:  7363 7269 7074 696f 6e00 2d2d 7461 7267 6574 2d70 6c61 7466  :scription.--target-platf
@gregblass
gregblass / checkboxes.scss
Last active June 2, 2018 10:46
Fancy CSS styling for Radio Buttons and Checkboxes
/*********************
Fancy CSS Textboxes
**********************/
$light-blue: #609FD5;
input[type="checkbox"] {
position: absolute;
left: -9999px;
visibility: hidden;