Skip to content

Instantly share code, notes, and snippets.

@timfee
timfee / timezones.ts
Last active April 19, 2024 18:51
Friendly Timezones
type TimeZoneInfo = {
friendlyName: string
offsetString: string
offsetNumeric: number
longTimezones: string[]
}
function offsetStringToNumeric(offsetString: string): number {
const sign = offsetString.startsWith("GMT-") ? -1 : 1
const [hours, minutes] = offsetString.slice(4).split(":").map(Number)
@staltz
staltz / introrx.md
Last active April 19, 2024 18:49
The introduction to Reactive Programming you've been missing
@graydon
graydon / country-bounding-boxes.py
Created April 23, 2014 00:03
country bounding boxes
# extracted from http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip
# under public domain terms
country_bounding_boxes = {
'AF': ('Afghanistan', (60.5284298033, 29.318572496, 75.1580277851, 38.4862816432)),
'AO': ('Angola', (11.6400960629, -17.9306364885, 24.0799052263, -4.43802336998)),
'AL': ('Albania', (19.3044861183, 39.624997667, 21.0200403175, 42.6882473822)),
'AE': ('United Arab Emirates', (51.5795186705, 22.4969475367, 56.3968473651, 26.055464179)),
'AR': ('Argentina', (-73.4154357571, -55.25, -53.628348965, -21.8323104794)),
'AM': ('Armenia', (43.5827458026, 38.7412014837, 46.5057198423, 41.2481285671)),
@kizzx2
kizzx2 / docker-compose.yml
Last active April 19, 2024 18:47
Restart a docker container periodically with docker-compose
version: '3'
services:
app:
image: nginx:alpine
ports: ["80:80"]
restart: unless-stopped
restarter:
image: docker:cli
volumes: ["/var/run/docker.sock:/var/run/docker.sock"]
@felquis
felquis / top-portfolio-front-end.md
Last active April 19, 2024 18:45
Portifólios legais de desenvolvedores Front-end que encontrei por ai

Developer's Web Sites, Portfolio and blogs

Os links aqui estão sem nenhum tipo de ordenação, então o que esta por ultimo não é necessariamente o mais ruim na minha opinião e o que esta primeiro não necessariamente é o melhor, sabendo disso, vamos a lista.

@irazasyed
irazasyed / manage-etc-hosts.sh
Created March 7, 2015 09:16
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/bin/sh
# PATH TO YOUR HOSTS FILE
ETC_HOSTS=/etc/hosts
# DEFAULT IP FOR HOSTNAME
IP="127.0.0.1"
# Hostname to add/remove.
HOSTNAME=$1
@Klerith
Klerith / instalaciones-ts.md
Last active April 19, 2024 18:44
Instalaciones del curso de TypeScript
@k-takata
k-takata / bash-completion-slowness-on-msys2.md
Created May 13, 2015 15:08
Bash-completion is very slow on MSYS2

Bash-completion is very slow on MSYS2

Bash-completion is very slow on MSYS2 when the current user is a domain user. This describes the cause and the solutions.

Cause

Expansion of ~* is very slow when you use a domain user. For example:

@lightonphiri
lightonphiri / bash-install_google_fonts_on_ubuntu.md
Last active April 19, 2024 18:44
Install Google Fonts on Ubuntu

Install Google Fonts

Download desired fonts

https://fonts.google.com/?selection.family=Open+Sans

Install Google Fonts on Ubuntu

cd /usr/share/fonts
sudo mkdir googlefonts
cd googlefonts
sudo unzip -d . ~/Downloads/Open_Sans.zip

@Amzd
Amzd / ColorPicker.swift
Last active April 19, 2024 18:42
What SwiftUI's ColorPicker should have been.
import SwiftUI
@available(iOS 14.0, *)
public struct ColorPickerWithoutLabel: UIViewRepresentable {
@Binding var selection: Color
var supportsAlpha: Bool = true
public init(selection: Binding<Color>, supportsAlpha: Bool = true) {
self._selection = selection
self.supportsAlpha = supportsAlpha