Skip to content

Instantly share code, notes, and snippets.

View Tnifey's full-sized avatar
⁉️

Hubert Tnifey

⁉️
View GitHub Profile
@Tnifey
Tnifey / clock-plugin.js
Created October 27, 2021 20:11
react-pluggable ReduxPlugin MVP
import { IPlugin } from "react-pluggable";
export default class ClockPlugin implements IPlugin {
init(pluginStore) {
this.pluginStore = pluginStore;
}
getPluginName() {
return `ClockPlugin@0.0.0`;
}
@Tnifey
Tnifey / index.js
Last active October 23, 2021 21:57
test-plugin-for-electron
export function init(extensionPoints) {
console.log("[Extension] HELLO EXTENSION", extensionPoints);
extensionPoints.register( 'someplug:register', 'someplug', (...args) => {
console.log("[REGISTER] someplug", ...args);
})
extensionPoints.register( 'router:register', 'someplug', (...args) => {
console.log("[REGISTER] someplug -> router:register", ...args);
})
@Tnifey
Tnifey / argon2.lib.ts
Created September 15, 2021 09:28
argon2.lib.ts
import { argon2id, argon2Verify } from "https://cdn.skypack.dev/hash-wasm@v4.9.0";
/**
* deno 1.13.1 (release, x86_64-unknown-linux-gnu)
* v8 9.3.345.11
* typescript 4.3.5
*/
export type HashOptions = {
salt?: String | Uint8Array;
@Tnifey
Tnifey / gist:c7279322eacb3fbb7d7e4774f10b35b8
Created November 18, 2020 13:33
[tempermonkey][userscript] paste to preview image on google images
// ==UserScript==
// @name Search Image from clipboard
// @namespace https://github.com/tnifey
// @version 0.1
// @description Google Images - Search By Paste Image from clipboard
// @author Tnifey
// @match https://images.google.com/*
// @match https://google.com/imghp
// @match https://google.com/imghp*
// @grant none
@Tnifey
Tnifey / chain.ts
Created October 25, 2020 12:21
Get Prototype Chain From Class Constructor (extends chain)
import { Ctor } from "./types";
import { isConstructor } from "./utils";
export function chain<T>(
ctor: Ctor<T>,
prototypes: Set<any> = new Set(),
): Ctor<any>[] | Set<Ctor<any>> {
if (isConstructor(ctor)) {
const target = Object.getPrototypeOf(ctor);
if (!target.name || prototypes.has(target)) return prototypes;
@Tnifey
Tnifey / .denon.json
Created May 20, 2020 06:24
denon - config - example
{
"files": ["test.ts"],
"quiet": false,
"debug": true,
"fullscreen": false,
"extensions": [".js", ".ts", ".py", ".json"],
"interval": 500,
"watch": ["test.ts"],
"deno_args": [
"--allow-all",
@Tnifey
Tnifey / dateExists.ts
Last active December 1, 2019 22:03
function checks if date exists/ is date valid
function dateExists(year: number, month: number, day: number): boolean {
if (typeof year !== "number") year = Number.parseInt(`${year}`, 10);
if (typeof month !== "number") month = Number.parseInt(`${month}`, 10);
if (typeof day !== "number") day = Number.parseInt(`${day}`, 10);
if (year && month && day) {
if (day >= 1 && day <= 31 && month >= 1 && month <= 12) {
const d = `${day}`.padStart(2, "0");
const m = `${month}`.padStart(2, "0");
const y = `${year}`.padStart(4, "0");
@Tnifey
Tnifey / loading-worm.sass
Created September 29, 2017 14:01
Loading Worm
.loading
display: block
position: fixed
top: 50%
left: 50%
transform: translate(-50%, -50%)
display: flex
align-items: center
justify-content: center
width: 100%
@Tnifey
Tnifey / flexboxgrid.sass
Created September 28, 2017 16:59
flexboxgrid.sass
.row
box-sizing: border-box
display: flex
flex: 0 1 auto
flex-direction: row
flex-wrap: wrap
padding-left: 1rem
padding-right: 1rem
&.no-padding
padding-left: 0