short url: caseywatts.com/selfpublish
my book is out! an applied psychology / self-help book targeted at developers: Debugging Your Brain
Markdown
--> PDF
(as a booklet!)
Markdown
--> EPUB
and MOBI
export function IsolateCSS(props: { children: React.ReactNode }) { | |
const onceRef = useRef(false); | |
const [shadowRoot, setShadowRoot] = useState<ShadowRoot>(); | |
const ref = useCallback((ref: HTMLDivElement | null) => { | |
if (ref && onceRef.current === false) { | |
onceRef.current = true; | |
setShadowRoot(ref.attachShadow({ mode: 'open' })); | |
} | |
}, []); |
#!/bin/bash | |
# bash script to send messages to Microsoft Teams. | |
function usage { | |
echo "ALERT!" | |
echo "description: send messages to Microsoft Teams channels" | |
echo "special notes: You'll need to change the teamsUrl variable to contain your webhook from Teams." | |
echo "usage: ${0} -b \"Message contents\"" | |
echo " -m Message body" | |
echo " -h This help info" | |
exit 1 |
short url: caseywatts.com/selfpublish
my book is out! an applied psychology / self-help book targeted at developers: Debugging Your Brain
Markdown
--> PDF
(as a booklet!)
Markdown
--> EPUB
and MOBI
//------------------------------------------------------------------------ | |
// The SwiftUI Lab: Advanced SwiftUI Animations | |
// https://swiftui-lab.com/swiftui-animations-part1 (Animating Paths) | |
// https://swiftui-lab.com/swiftui-animations-part2 (GeometryEffect) | |
// https://swiftui-lab.com/swiftui-animations-part3 (AnimatableModifier) | |
//------------------------------------------------------------------------ | |
import SwiftUI | |
struct ContentView: View { | |
On the Android device, enable Developer options, and enable USB debugging.
On the Mac:
$ brew install ffmpeg --with-ffplay
$ adb shell screenrecord --output-format=h264 - | ffplay - -x 720 -y 1280
Replace the 720
and 1280
with other values to scale the output as desired.
import React from 'react'; | |
import { shallow } from 'enzyme'; | |
import MyComponent from '../src/my-component'; | |
const wrapper = shallow(<MyComponent/>); | |
describe('(Component) MyComponent', () => { | |
it('renders without exploding', () => { | |
expect(wrapper).to.have.length(1); | |
}); |
// | |
// DON'T do this, or else you risk a deadlock (e.g., by accidentally performing it in a different order somewhere) | |
// | |
dispatch_async(firstQueue, ^{ | |
dispatch_sync(secondQueue, ^{ | |
// code requiring both queues | |
}); | |
}); |