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
export const useTraceUpdate = (props) => { | |
const prev = useRef(props) | |
useEffect(() => { | |
const changedProps = Object.entries(props).reduce((ps, [k, v]) => { | |
if (prev.current[k] !== v) { | |
ps[k] = [prev.current[k], v] | |
} | |
return ps | |
}, {}) | |
if (Object.keys(changedProps).length > 0) { |
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
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction | |
import { Node as Logtail } from '@logtail/js'; | |
const logger = new Logtail(process.env.LOGTAIL_SOURCE_TOKEN); | |
export default async function handler(req, res) { | |
const user = { | |
id: 123, | |
name: 'John Doe', |
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
#include <nfc/nfc.h> | |
int main () | |
{ | |
nfc_device_t *nfcDev; | |
nfcDev = nfc_connect(NULL); | |
if (nfcDev == NULL) { | |
printf("Cannot connect to the RFID reader.\n"); | |
return 1; |
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
package boilingcore | |
import ( | |
"fmt" | |
"github.com/volatiletech/sqlboiler/drivers" | |
"github.com/volatiletech/sqlboiler/strmangle" | |
"strings" | |
) |