Skip to content

Instantly share code, notes, and snippets.

View mainiak's full-sized avatar

Jakub Viták mainiak

View GitHub Profile
@gmlewis
gmlewis / server.go
Last active June 19, 2023 16:03
Mechanism to perform OAuth2 dance (e.g. with Keycloak) in a wails production build
// Copyright (C) 2023 Omics Data Automation, Inc. - All Rights Reserved
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@craig-m-unsw
craig-m-unsw / README.md
Last active February 21, 2024 10:08
Parallels (MacOS M1 host) Packer + Vagrant of Ubuntu 20.04 arm64. Installed with cloud-init and configured with Ansible.

parallels Packer (arm64)

A simple Packer + Vagrant install of Ubuntu 20.04 (Focal Fossa) LTS server for arm64, to run from my M1 Mac on Parallels Pro (17.1). Currently on MacOS Monterey.

Packer will run the ansible playbook.yml before the machine is shutdown and exported.

The installation is automated by cloud-init (which reads user-data). The file meta-data just needs to be an empty text file (you need to create this - no blank files or folders allowed in gists).

ubuntu2004/
@rbo
rbo / README.md
Last active August 30, 2023 11:30
How to disable yubikey / certificate for firefox

Firefox Settings

-> Privacy & Security -> Security Devcices

image

Before

2021-08-24-16-43-29-1629816209

@RangerMauve
RangerMauve / hyperbee-indexed.md
Last active April 6, 2024 13:33
Hyperbee Indexed DB

Hyperbee Indexed DB

Purpose:

Hyperbee is super useful for storing data and searching for data using it's ordered key search. When you set up your keyspace just right, you can query a small subset of a large database and quickly load what you need without having to download the entire dataset or traverse it.

This module seeks to make it easier to set up these indexes for JSON data and to make it easy to query large datasets.

How it works

@warpfork
warpfork / WarpVer.md
Last active June 5, 2024 09:55
WarpVer -- it's not semver

WarpVer Versioning

A software versioning scheme.

It's not semver ™️.

The Rules

@StefansArya
StefansArya / moment.loadLocale.js
Last active March 31, 2020 04:26
Dynamically load locale for moment.js
;(function(){
if(window.moment === void 0)
return console.error("Moment.js must be loaded first");
var cdnLink = 'https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/locale/';
var loaded = new Set();
var available = ['af','ar-dz','ar-kw','ar-ly','ar-ma','ar-sa','ar-tn','ar','az','be','bg','bm','bn','bo','br','bs','ca','cs','cv','cy','da','de-at','de-ch','de','dv','el','en-au','en-ca','en-gb','en-ie','en-il','en-nz','en-SG','eo','es-do','es-us','es','et','eu','fa','fi','fo','fr-ca','fr-ch','fr','fy','ga','gd','gl','gom-latn','gu','he','hi','hr','hu','hy-am','id','is','it-ch','it','ja','jv','ka','kk','km','kn','ko','ku','ky','lb','lo','lt','lv','me','mi','mk','ml','mn','mr','ms-my','ms','mt','my','nb','ne','nl-be','nl','nn','pa-in','pl','pt-br','pt','ro','ru','sd','se','si','sk','sl','sq','sr-cyrl','sr','ss','sv','sw','ta','te','tet','tg','th','tl-ph','tlh','tr','tzl','tzm-latn','tzm','ug-cn','uk','ur','uz-latn','uz','vi','x-pseudo','yo','zh-cn','zh-hk','zh-tw'];
moment.lo
@janeczku
janeczku / 00-cloud-config.yml
Last active May 24, 2024 04:06
Annotated RancherOS Cloud-init configuration snippets
#cloud-config
# Set the hostname for this machine (takes precedence over hostname assigned by DHCP lease).
hostname: myhost
# Authorize SSH keys for the `rancher` sudoer user
ssh_authorized_keys:
- ssh-rsa AAA...ZZZ example1@rancher
@asukakenji
asukakenji / 0-go-os-arch.md
Last active July 2, 2024 13:30
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@int128
int128 / README.md
Last active January 21, 2024 14:52
Watching build mode on Create React App

Create React App does not provide watching build mode oficially (#1070).

This script provides watching build mode for an external tool such as Chrome Extensions or Firebase app.

How to Use

Create a React app.

Put the script into scripts/watch.js.

@jesperorb
jesperorb / cors.md
Last active February 21, 2024 14:17
Handle CORS Client-side

Handle CORS Client-side

Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside the domain from which the first resource was served. This is set on the server-side and there is nothing you can do from the client-side to change that setting, that is up to the server/API. There are some ways to get around it tho.

Sources : MDN - HTTP Access Control | Wiki - CORS

CORS is set server-side by supplying each request with additional headers which allow requests to be requested outside of the own domain, for example to your localhost. This is primarily set by the header:

Access-Control-Allow-Origin