Skip to content

Instantly share code, notes, and snippets.

View reimertz's full-sized avatar
🌈
😍😂😃😀🙂🤔😐🙁😟🥺😣😖😭

Piérre Reimertz reimertz

🌈
😍😂😃😀🙂🤔😐🙁😟🥺😣😖😭
View GitHub Profile
@reimertz
reimertz / getSoundEditionNumber.js
Created September 7, 2022 14:37
getSoundEditionNumber.js
const getSoundEditionNumber = (str) => {
const match = str.match(/#[0-9]+$/)
return match ? match[0].split('#')[1] : false
}
getSoundEditionNumber('An amazing track #1')
//"1"
getSoundEditionNumber('An amazing track #2')
//"2"
export const locales = [
'Cy-az-AZ',
'Cy-sr-SP',
'Cy-uz-UZ',
'Lt-az-AZ',
'Lt-sr-SP',
'Lt-uz-UZ',
'aa',
'ab',
'ae',
@reimertz
reimertz / groupPeople.js
Last active June 22, 2020 08:20
Function to create groups based on Google Meet participanst.
/*
optimalSize; Group size, if uneven, last group will contain one more member.
ignoreNames; A list if names you'd like to ignore. Good when some people can't participate.
*/
groupPeople1337 = (optimalSize = 2, ignoreNames = []) => {
const onlyUnique = (value, index, self) => {
return self.indexOf(value) === index;
}
const shuffleArray = (arr) => {
@reimertz
reimertz / asd
Created December 11, 2019 02:32
adasd
https://send.firefox.com/download/84e91a413e5ca5a7/#AB8SLcOgnP88XMA1nuyj9Q
@reimertz
reimertz / asd
Created December 11, 2019 02:28
asd
https://send.firefox.com/download/71dee0652e458a91/#LGS2NUvEI3SaWNiT9aYAgg
@reimertz
reimertz / asasd
Created December 11, 2019 02:19
asd
https://send.firefox.com/download/153e5ac97f410fe1/#un3Dhp35BWibTMXfmnamvA
@reimertz
reimertz / 1.rxjs-firestore.js
Last active May 3, 2023 02:57
RxJS + Firestore + React hooks basics
import { Observable, combineLatest } from 'rxjs'
import { startWith } from 'rxjs/operators'
import { useEffect, useState } from 'react'
export const docData = doc => {
const data = doc.data()
const idKey = data && data.id ? 'firebaseId' : 'id' // if original data contains an id..
return {
...data,
import { Observable, interval, combineAll, combineLatest } from 'rxjs'
import { zip, startWith, timeInterval } from 'rxjs/operators'
import { useEffect, useState } from 'react'
import RNFirebase from '@react-native-firebase/app'
export const docData = doc => {
const data = doc.data()
const idKey = data && data.id ? 'firebaseId' : 'id'
@reimertz
reimertz / Erik.md
Last active March 16, 2018 17:25
Erik.md

HAHAHAHAHAHAHAHAHA

så jefla trollad!

Vår 30 års present till dig är att

  1. Vi båda kommer och hälsar på innan sommaren är slut
  2. Vi tar med 40kg av din skit
@reimertz
reimertz / locations.js
Created October 16, 2017 22:46
code stuff
const locations = [{
name: 'MAP STUDIO',
url: 'https://www.makersrecord.com/map-studio',
cost: '250',
shortDescription: 'yolo 4 life ......',
location: {
long: 'asdadssd',
lat: 'adakd;ladska;lsdk'
}
}, {