Skip to content

Instantly share code, notes, and snippets.

View Abrifq's full-sized avatar
🔎
Currently in Bulgaria, looking for commissioned work. Intermediate JS/C# exp.

Arda Aydın Abrifq

🔎
Currently in Bulgaria, looking for commissioned work. Intermediate JS/C# exp.
View GitHub Profile
@Abrifq
Abrifq / .npmrc
Created November 19, 2023 04:43
Manage multiple registries with this NPM hack!
@@github:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=authtoken
//registry.npmjs.org/:_authToken=authtoken
@Abrifq
Abrifq / we-hate-qt5-around-here
Created July 21, 2023 12:50
Man, qt5 got me down
libgbm1=22.3~git2209210600.3ce1db~oibaf~j
libcogl-path20
gnome-user-docs
gstreamer1.0-gl
mpv
audacious
gstreamer1.0-clutter-3.0
libcogl20
libmutter-10-0
audacious-plugins
@Abrifq
Abrifq / PRISMA_OUTPUT.md
Created January 28, 2022 23:05
Prisma bug occuring on one-to-one relationships

Command:

DEBUG="*" prisma format --schema="./schema.prisma"
# Edited schema path to upload as a gist

Output:

  prisma:loadEnv project root found at /tmp/package.json +0ms
  prisma:tryLoadEnv Environment variables loaded from /tmp/.env +0ms
Environment variables loaded from .env
@Abrifq
Abrifq / randomizeArray.js
Last active March 7, 2021 16:26
Randomize an Array
const randomInt = max => (Math.random() * max) | 0;
const randomSort = (array, passes=3)=>{
for( /*We don't need to declare a new variable*/ ; passes>0; passes--){
const index1 = randomInt(array.length),
index2 = randomInt(array.length);
const temp = array[index1];
array[index1] = array[index2];
array[index2] = temp;
}
}
@Abrifq
Abrifq / test_privateFields_es2020.js
Last active August 16, 2020 12:57
This is a test script to test the new "private fields" in classes. (May not work now due to incomplete implementation)
class PrivateNameTest{
#lucky_number; //This hopefully can be tried without the semicolon once the proposal is implemented.
constructor(){
this.#lucky_number = 42;
}
guessLuckyNumber(guessedNumber){return guessedNumber===this.#lucky_number;}
}
class PrivateDefTest{
#arePrivateVariablesAwesome = true;
@Abrifq
Abrifq / filterNotMatchGenerator.js
Last active September 4, 2019 12:32
This function takes an array as an input, then produces a NOT match filter Function, which can be used with Array.prototype.filter later on.
const notMatch = array => value => !array.includes(value);
//testing
const newFilter = notMatch([3,5]);
const array125 = [... Array(125).keys()];
console.log ( array125.length);
const filteredArray = array125.filter(newFilter);
console.log ( filteredArray.length)
//Lets try to get the [3,5] array back using two NOT filters
console.log ( array125.filter ( notMatch(filteredArray)) );