Skip to content

Instantly share code, notes, and snippets.

View tsuz's full-sized avatar

T Suzuki tsuz

  • Tokyo, Japan
  • 20:02 (UTC +09:00)
View GitHub Profile

The editor

I built a simple editor using Mapbox GL JS in order to play and retrieve coordinates. In this example, the map is 1024x1024 pixels wide.

The editor

My goal was to have a matrix of 2x2 images as you can see in this following image

The code

Here you can find the code used to generate the 4 images

@rgazelot
rgazelot / map.js
Created March 19, 2020 09:42
Final version
const bounds = poster.bounds
// Use geoViewport to determine the center and the zoom level of the entire map.
const viewport = geoViewport.viewport([
bounds['_sw'].lng,
bounds['_sw'].lat,
bounds['_ne'].lng,
bounds['_ne'].lat
], [size.width, size.height], undefined, undefined, 512, true)
@rturk
rturk / useCrisp.js
Created July 8, 2020 16:38
useCrisp - Load Crisp Chat with React App
import { useEffect, useRef } from 'react';
import { useScript } from './useScript';
//This will generate a new number every hour
//Crisp has a terrible CDN handeling process, this forces to load last version every hour
const getDateSeconds = () => {
const date = new Date();
const time = date.getTime();
return Math.floor(time / 3600000);
@brennanMKE
brennanMKE / README.md
Last active February 10, 2025 11:04
Create SSH Key on Mac for Xcode

Create SSH Key on Mac for Xcode

The docs for GitHub show a command to create a key with the ed25519 encryption method which is not allowed by Xcode. Even if you are not using the Source Control features in Xcode you will often need to use an account with GitHub when you are consuming Swift packages which are pulled from GitHub.

For SSH keys there are 4 algorithms.

  • 🚨 DSA: This is an older algorithm which is no longer supported and is superceded with more modern algorithms.
  • ⚠️ RSA: This algorithm was an improvement but it is now outdated and a more modern method should be used.
  • 👀 ECDSA: Another improvement which is dependent on your computer's ability to generate random numbers.
  • ✅ Ed25519: The most recommended public-key algorithm today which you should use with GitHub.