This should setup python environment on Ubuntu 20 (Ubuntu 20.04.6 LTS)
Instructions: https://pip.pypa.io/en/stable/installation/#get-pip-py
- Download
get-pip.py
file:wget https://bootstrap.pypa.io/get-pip.py
- Install distutils:
This should setup python environment on Ubuntu 20 (Ubuntu 20.04.6 LTS)
Instructions: https://pip.pypa.io/en/stable/installation/#get-pip-py
get-pip.py
file:
wget https://bootstrap.pypa.io/get-pip.py
The Reverse-DNS convention implies that the value should start with a reversed DNS domain name controlled by the author of the applicatoin.
The domain name should be followed by a subdomain or a product name. Example: com.example.MyProductName
.
/** | |
* As of writing, Promise.any is Stage 4 (Finished) | |
* This code is just a fun reminder of how Promise.any can be implemented using Promise.all | |
* Proposal: https://github.com/tc39/proposal-promise-any | |
*/ | |
class AggregateErrorFallback extends Error { | |
errors: Array<Error>; | |
constructor(message: string, errors: Array<Error>) { | |
super(message); |
var el = document.getElementById('el'); | |
document.addEventListener('click', outsideEvtListener); | |
function outsideEvtListener(evt) { | |
if (evt.target === el || el.contains(evt.target)) { | |
return; | |
} | |
// code handling outside click | |
(function() { | |
'use strict'; | |
if (window.FormData) { | |
FormData.prototype.appendObject = function (obj, namespace) { | |
// EXAMPLE: | |
// var person = { name: 'some name', age: 87 }; | |
// var fd = new FormData(); | |
// fd.appenObject(obj, 'person'); |
function JsSpinner() { | |
const ref = useRef<HTMLDivElement | null>(null); | |
useEffect(() => { | |
let deg = 0; | |
let id = 0; | |
function rotate() { | |
id = requestAnimationFrame(() => { | |
ref.current.style.transform = `rotate(${(deg += 2) % 360}deg)`; | |
rotate(); | |
}); |
// just a reminder of a nice API for a <Script /> component, | |
// reference: https://nextjs.org/docs/basic-features/script#executing-code-after-mounting-onready | |
import { useRef } from 'react' | |
import Script from 'next/script' | |
export function Home() { | |
const mapRef = useRef() | |
return ( | |
<> |
import { useEffect, useMemo } from 'react'; | |
import debounce from 'lodash/debounce'; | |
export function useDebouncedCallback( | |
callback: (...args: any) => any, | |
delay: number, | |
) { | |
const debouncedCallback = useMemo( | |
() => debounce(callback, delay), | |
[callback, delay], |
import { useCallback, useState } from 'react'; | |
import { useQuery } from 'react-query'; | |
import type { | |
QueryKey, | |
QueryFunction, | |
UseQueryOptions, | |
UseQueryResult, | |
} from 'react-query'; | |
/** |
0x05baa67af0201cf90f07237b4fcd77ff375a391f705d31a007802a92c480a950