Skip to content

Instantly share code, notes, and snippets.

View tsuz's full-sized avatar

T Suzuki tsuz

  • Tokyo, Japan
  • 14:02 (UTC +09:00)
View GitHub Profile
@brennanMKE
brennanMKE / README.md
Last active April 3, 2024 21:49
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.
@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);
@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)

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

@StevenACoffman
StevenACoffman / goGetPrivate.md
Last active April 28, 2024 13:59 — forked from dmitshur/gist:6927554
How to `go get` private repos using SSH key auth instead of password auth.

Set GOPRIVATE to match your github organization

Cloning the repo using one of the below techniques should correctly but you may still getting an unrecognized import error.

As it stands for Go v1.13, I found in the doc that we should use the GOPRIVATE variable like so:

GOPRIVATE=github.com/ORGANISATION_OR_USER_NAME go get -u -f github.com/ORGANISATION_OR_USER_NAME/REPO_NAME

The 'go env -w' command (see 'go help env') can be used to set these variables for future go command invocations.

How to go get private repos using SSH key auth instead of password auth.

@jlis
jlis / .gitlab-ci.yml
Created May 15, 2018 13:16
AWS ECS and ECR deployment via Docker and Gitlab CI
image: docker:latest
variables:
REPOSITORY_URL: <AWS ACCOUNT ID>.dkr.ecr.eu-central-1.amazonaws.com/<ECS REPOSITORY NAME>
REGION: eu-central-1
TASK_DEFINTION_NAME: <TASK DEFINITION NAME>
CLUSTER_NAME: <CLUSTER NAME>
SERVICE_NAME: <SERVICE NAME>
services:
@rodkranz
rodkranz / ReadBigFileAndParse.go
Created January 16, 2017 01:24
Read big file and unmarshal in json
// Package main
// Copyright 2017 Kranz. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
/**
Test read file by chunks
➜ read ll
total 13241936
drwxr-xr-x 5 rlopes staff 170B 16 Jan 01:19 ./
@pandafulmanda
pandafulmanda / Python3 Virtualenv Setup.md
Last active March 12, 2024 15:59 — forked from akszydelko/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@joemasilotti
joemasilotti / ..md
Last active September 13, 2022 14:20
Resetting NSUserDefaults in UI Testing

Resetting NSUserDefaults in UI Testing

  1. Add "UI-Testing" to launchArguments before launching the app under test
  2. On launch, check for the argument in AppDelegate.swift
  3. If it exists remove everything for the app's domain from NSUserDefaults
@yowu
yowu / HttpProxy.go
Last active April 27, 2024 20:17
A simple HTTP proxy by Golang
package main
import (
"flag"
"io"
"log"
"net"
"net/http"
"strings"
)