Skip to content

Instantly share code, notes, and snippets.

View Yoshyn's full-sized avatar
🇫🇷
Graou

Sylvestre Antoine Yoshyn

🇫🇷
Graou
View GitHub Profile
@Yoshyn
Yoshyn / iterator.js
Last active May 11, 2023 11:46
Some simple of writing iterator in javascript. Produce ce same result.
//Equivalence 1 :
async function * iterableFct() {
let i = 0;
while (i < 2) yield ++i;
}
const iterable = iterableFct();
await iterable[Symbol.asyncIterator]().next(); // 1
await iterable[Symbol.asyncIterator]().next(); // 2
for await (const response of iterable) {
@Yoshyn
Yoshyn / index.html
Last active January 11, 2023 16:36
Minimal notification javascript in browser
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<style>
html, body {
height: 100%;
margin-right: 5%;
@Yoshyn
Yoshyn / AWS SSO : Auto-allow.js
Created November 18, 2022 17:45
Tampermonkey scripts
// ==UserScript==
// @name AWS SSO : Auto-allow
// @namespace https://skillsoftsso.awsapps.com/
// @version 0.1
// @description Auto allow
// @author You
// @match https://skillsoftsso.awsapps.com/start/user-consent/authorize.html?clientId=*
// @grant none
// ==/UserScript==
@Yoshyn
Yoshyn / gist:0dab97ab9cb54b4a0cf66a1d59b54b9d
Created February 4, 2022 10:28
Kind, istio and localhost access
# Kind installation : https://istio.io/latest/docs/setup/platform-setup/kind/
kind create cluster --name istio-testing
kubectl config use-context kind-istio-testing
# Istio installation : https://istio.io/latest/docs/setup/getting-started/
istioctl install --set profile=demo -y
...
@Yoshyn
Yoshyn / .Description
Last active September 5, 2023 12:32
Setup mac
Main step to the setup of my mac.
@Yoshyn
Yoshyn / .Description
Last active September 2, 2021 12:37
Rails last version & docker-compose setup easy
Rails last version & docker-compose setup easy
@Yoshyn
Yoshyn / sqlite3.Dockerfile
Created March 5, 2021 19:17
Docker & Sqlite3 backup. Volume manipulation
# docker build -f sqlite3.Dockerfile -t sqlite3:local .
# docker run --rm -it -v sqlite-db-volume:/db sqlite3:local my_app.db
FROM alpine:latest
RUN apk add --update sqlite
RUN mkdir /db
WORKDIR /db
ENTRYPOINT ["sqlite3"]
CMD ["my_app.db"]
@Yoshyn
Yoshyn / coding_game.rb
Last active May 10, 2020 13:01
Sample stuff for gaming with coding_game
require "minitest/autorun"
require "pry-byebug"
class Position
DIRECTIONS= %i(north east south west)
class Radius
include Enumerable
def initialize(value); @value =value; end
@Yoshyn
Yoshyn / openssl.md
Last active October 22, 2021 15:15
Verify a certificat (crt) and a private key

Let's check

Check the certificat openssl x509 -in certificate.crt -text -noout

Compare the certificat & the private key; This :

openssl x509 -modulus -noout -in mycomp.com.crt | openssl md5

Should return the same as :

@Yoshyn
Yoshyn / gist:2fd029d57c2e8871730fe4481493c753
Last active April 21, 2020 18:19
Minimal test case to perform an override with newrelic on httpotion
defmodule Base do
defmacro __using__(_) do
quote do
def process, do: "Base.process"
def request, do: "Base.request"
defoverridable Module.definitions_in(__MODULE__)
end
end
end