This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
This Gist demonstrates how to use an invasive jQuery plugin (UI Sortable) with | |
the latest version of Ractive.js (0.3.7). | |
It was built as an analogue to https://gist.github.com/petehunt/7882164, which | |
illustrates how to pair jQuery UI Sortable with React. I would contend that | |
Ractive.js plays more nicely with this plugin. | |
The key takeaway from this exercise is that you must not allow a third-party | |
plugin (e.g., jQuery) to change the DOM in a manner that its structure no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// fork of https://gist.github.com/b-nnett/2749adb44566239e4c85ad1a8937c2bc | |
// origin by @B_nnett → https://twitter.com/joshm/status/1648346253355282432?s=20 | |
/* | |
To set up this boost for chat.openai.com: | |
1) open Arc browser and login at chat.openai.com. | |
2) Head over to the + button in your sidebar and select New Boost. | |
Or hit ⌘ + T and type New Boost into your Command Bar. | |
3) Click the `Code` button. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// EmailInput wraps an HTML `input` and adds some app-specific styling. | |
const EmailInput = React.forwardRef((props, ref) => ( | |
<input ref={ref} {...props} type="email" className="AppEmailInput" /> | |
)); | |
class App extends Component { | |
emailRef = React.createRef(); | |
render() { | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react'; | |
import {Platform, StyleSheet, Text, View, StatusBar} from 'react-native'; | |
const instructions = ` | |
This app demonstrates the proposed imperative stack-manipulation methods on \`StatusBar\`. | |
`; | |
const pad = (value, width) => ( | |
`${value}${Array(width - String(value).length).fill(' ').join('')}` | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 76ad8283e5de2a0733cbac375c0c16d1d03de891 Mon Sep 17 00:00:00 2001 | |
From: James Reggio <james.reggio@gmail.com> | |
Date: Wed, 14 Feb 2018 18:57:24 -0500 | |
Subject: [PATCH] add trace statements to JSCLoadApp fn | |
--- | |
ReactCommon/cxxreact/JSCExecutor.cpp | 32 ++++++++++++++++++++++++++++++++ | |
1 file changed, 32 insertions(+) | |
diff --git a/ReactCommon/cxxreact/JSCExecutor.cpp b/ReactCommon/cxxreact/JSCExecutor.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This script will help to diagnose popup blocker issues. | |
// Copy-paste it into your console, or include it in your development build. | |
// | |
// When you make a call to window.open(), this script will check whether the | |
// most recent user input event happened on the same tick. (If not, a | |
// breakpoint is triggered and an explanation is written to the console.) | |
// | |
// You can manually call window.debugOpen() at any time to determine the | |
// whether it's safe to insert a call to window.open() in the current code. | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Even though CurrentEpisodeWaveform is a component class that | |
// properly composes the three HOCs with Waveform, its static | |
// properties make it appear like a `forwardRef` component type. | |
const CurrentEpisodeWaveform = compose( | |
withCurrentEpisode, | |
withEpisodeAmplitudes, | |
withSize | |
)(Waveform); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Waveform.js | |
import React, { Component } from 'react'; | |
export default class Waveform extends Component { | |
static MIN_AMPLITUDE = 0; | |
static MAX_AMPLITUDE = 100; | |
render() { | |
console.log('Received props:', Object.keys(this.props)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const WrappedInput = React.forwardRef((props, ref) => ( | |
<input ref={ref} {...props} /> | |
)); | |
console.log(WrappedInput); | |
// => Object { | |
// $$typeof: Symbol(react.forward_ref), | |
// render: (props, ref) => <input ref={ref} {...props} />, | |
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
############################################################################### | |
# USAGE | |
############################################################################### | |
# 1. Install the `react-is` package in your project with | |
# `npm i --save react-is` or `yarn add react-is`. | |
# | |
# 2. Place this script in the root of your repository, alongside `package.json`. | |
# |
NewerOlder