sudo nano /etc/lightdm/lightdm.conf
Make sure these two pieces are set/unset:
greet-hide-users=false
...
const randLetter = (start = "A", end = "Z") => String.fromCharCode( | |
Math.floor(Math.random() * (end.charCodeAt(0) - start.charCodeAt(0) + 1)) + start.charCodeAt(0) | |
) | |
randLetter() // "F" | |
randLetter('a', 'd') // "d" |
// You can adjust these params to suit your actual dimensions | |
const width = 10; | |
const height = 10; | |
const idx = (y, x) => y * height + x | |
// GIVEN: | |
// const matrix1D = [0,1,2,3, /* ... */, 98,99] | |
// const matrix2D = [ | |
// [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], |
import { useEffect, useState } from 'react' | |
const _logEntries = new Set() | |
function log (...args) { | |
const entry = { args, id: performance.now() } | |
_logEntries.add(entry) | |
window.dispatchEvent(new CustomEvent('custom-log', { detail: entry })) | |
} |
window.make = (type, { children = [], ...props } = {}, attrs = {}) => { | |
let elem = document.createElement(type) | |
Object.assign(elem, props) | |
if (children instanceof Array) { | |
children.forEach(child => elem.appendChild(child)) | |
} else if (children instanceof Node) { | |
elem.appendChild(children) | |
} else { | |
elem.innerText = children | |
} |
function secretSanta(...names) { | |
const randomized = [...names].sort(() => Math.random() - Math.random()); | |
const derrangement = [...randomized] | |
derrangement.unshift(derrangement.pop()) // shifting ensures a derrangement of the randomized list | |
return Object.fromEntries(randomized.map((name, idx) => [name, derrangement[idx]])) | |
} | |
secretSanta('Alice', 'Bob', 'Carter', 'David', 'Emily') | |
// { Carter: 'Emily', Bob: 'Carter', David: 'Bob', Alice: 'David', Emily: 'Alice' } |
import React, { useImperativeHandle, useRef, forwardRef, useCallback, useEffect } from 'react' | |
export const Component = forwardRef(({ callbackRef }, externalRef) => { | |
const internalRef = useRef() | |
// use imperative handle lets you "sync" any number of external refs with the value of the internalRef | |
useImperativeHandle(externalRef, () => internalRef.current) | |
useImperativeHandle(callbackRef, () => internalRef.current) | |
useEffect(() => { |
#!/bin/bash | |
########################################################################### | |
# USAGE Example: | |
# lang-cp from_dir from_file_prefix to_dir key1 key2 key3@KEY_3_NEW_NAME key4 | |
########################################################################### | |
from_list=$(find $1 | grep "$2_.*json") | |
echo "Copying from $2..." | |
for f in $from_list; do | |
lang=$(echo $f | cut -d '_' -f 2 | cut -d '.' -f 1) | |
to_lang=${lang//-/_} |
#!/bin/bash | |
url='https://services1.arcgis.com/0MSEUqKaxRlEPj5g/arcgis/rest/services/ncov_cases/FeatureServer/1/query?f=json&where=(Confirmed%20%3E%200)%20AND%20(Country_Region%3D%27US%27)&returnGeometry=false&spatialRel=esriSpatialRelIntersects&outFields=*&orderByFields=Confirmed%20desc%2CCountry_Region%20asc%2CProvince_State%20asc&outSR=102100&resultOffset=0&resultRecordCount=250&cacheHint=true' | |
__getStats () { | |
json <(curl -s "$url") " | |
const data = \$.features.filter(x => x && x.attributes && x.attributes.Province_State && x.attributes.Province_State.includes && x.attributes.Province_State.includes('$1')) | |
const { Confirmed, Deaths, Recovered } = (data && data[0] && data[0].attributes) || {}; | |
Confirmed && console.log('Confirmed: ' + Confirmed, 'Recovered: ' + Recovered, 'Deaths: ' + Deaths); | |
!Confirmed && console.log('No Data Found on $1') |