We have an object, containing nested locations and their coordinates:
const data = {
name: 'World',
coords: '0,0',
sweden: {
name: 'Sweden',| #!/usr/bin/env python3 | |
| """ | |
| Domain availability checker using RDAP + WHOIS fallback. | |
| Free, no API key needed. | |
| Strategy: | |
| 1. Try IANA bootstrap to find the RDAP server for the TLD | |
| 2. If not in bootstrap, try rdap.org (universal redirect service) | |
| 3. If no RDAP at all, fall back to WHOIS (port 43) |
| import React, { useEffect, useState } from "react"; | |
| import { Switch, Case } from "./Switch"; | |
| import "./styles.css"; | |
| export default function App() { | |
| const [count, setCount] = useState(1); | |
| useEffect(() => { | |
| const inverval = setInterval(() => { |
| # aliases | |
| git config --global alias.co checkout | |
| git config --global alias.br branch | |
| git config --global alias.ci commit | |
| git config --global alias.st status | |
| git config --global alias.lg 'log --oneline' | |
| git config --global alias.last 'log -1 HEAD' | |
| # git-completion | |
| npm i -g git-completion |
This is helpful if you've previously installed git from source on OSX, and other compilers can't find the correct path. You need to remove the current version of git, then re-install with brew.
which git
| .my-element { | |
| padding: 50px; | |
| background: yellow; | |
| [dir=rtl] & { | |
| float: right; | |
| } | |
| [dir=ltr] & { | |
| float: left; |
| $layout-direction: ltr !default; | |
| @mixin ltr { | |
| @if $layout-direction == ltr { | |
| @content; | |
| } | |
| } | |
| @mixin rtl { | |
| @if $layout-direction == rtl { | |
| @content; |
| /* ratio.scss output: */ | |
| .ratio-1-1 { | |
| display: block; | |
| position: relative; | |
| height: 0; | |
| overflow: hidden; | |
| padding-bottom: 100%; | |
| } | |
| .ratio-1-1 img { |