- Apollo
- Babel
- Serverless or CDK
- GraphQL
- MobX
- MobX State Tree
- NextJS
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
#! /usr/bin/env ruby | |
# | |
# missing_includes.rb | |
# By Jens Alfke <jens@couchbase.com> | |
# Version 2.0 -- 2 Oct 2023 | |
# Copyright 2021-Present Couchbase, Inc. | |
# | |
# This script scans C++ header files looking for usage of common standard library classes, like | |
# `std::vector`, without including their corresponding headers, like `<vector>`. It similarly looks | |
# for standard C functions like `strlen` that are used without including their header (`<cstring>`.) |
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
function traverseDOMNodes(node, predicates, cb) { | |
if (predicates.length === 0) { | |
// Base case: If there are no more predicates, invoke the callback. | |
return cb(node); | |
} | |
const [currentPredicate, ...remainingPredicates] = predicates; | |
const children = node.childNodes; | |
for (let child of children) { |
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
/** | |
* A PromiseLock like object. | |
* | |
* Used to ensure that we only do one thing at a time on a shared resource. | |
* | |
* For example, with async iterator: | |
* | |
* this.readLock = new Mutex() | |
* this.readLock.do(async () => { | |
* const data = await itr.next(); |
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
var music, musicParse; | |
musicParse = function(f) { | |
return eval("for(var t=0,S='RIFF_oO_WAVEfmt " + atob('EAAAAAEAAQBAHwAAQB8AAAEACAA') + "data';++t<3e5;)S+=String.fromCharCode(" + f + ")"); | |
}; | |
music = function() { | |
var audio, formula; | |
formula = '(t<<3)*[8/9,1,9/8,6/5,4/3,3/2,0][[0xd2d2c8,0xce4088,0xca32c8,0x8e4009][t>>14&3]>>(0x3dbe4688>>((t>>10&15)>9?18:t>>10&15)*3&7)*3&7]&255'; | |
audio = new Audio("data:audio/wav;base64," + (btoa(musicParse(formula)))); |
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
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam' | |
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes' | |
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no' |
If you use server rendering, keep in mind that neither useLayoutEffect
nor useEffect
can run until the JavaScript is downloaded.
You might see a warning if you try to useLayoutEffect
on the server. Here's two common ways to fix it.
If this effect isn't important for first render (i.e. if the UI still looks valid before it runs), then useEffect
instead.
function MyComponent() {
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
function createObservable(subscribe) { | |
return { | |
subscribe, | |
pipe: function(operator) { | |
return operator(this); | |
}, | |
}; | |
} | |
const numberObservable = createObservable(function(observer) { |
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
// ==UserScript== | |
// @name Goodbye new FB ads | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Remove facebook ads | |
// @author Maurizio Carboni | |
// @match https://www.facebook.com/* | |
// @grant none | |
// ==/UserScript== |
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, { Suspense } from 'react'; | |
import { Router } from '@reach/router'; | |
import Loading from './Loading'; | |
const Home = React.lazy(() => import('./Home')); | |
const Dashboard = React.lazy(() => import('./Dashboard')); | |
const Overview = React.lazy(() => import('./Overview')); | |
const History = React.lazy(() => import('./History')); | |
const NotFound = React.lazy(() => import('./NotFound')); |
NewerOlder