Skip to content

Instantly share code, notes, and snippets.

View tuarrep's full-sized avatar
😷
Stay at home!

Nicolas Perraut tuarrep

😷
Stay at home!
View GitHub Profile
@tuarrep
tuarrep / query.sql
Created April 22, 2024 18:48
UUIDv7 polyfill
-- Based off IETF draft, https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/
create or replace function uuid_generate_v7()
returns uuid
as $$
declare
unix_ts_ms bytea;
uuid_bytes bytea;
begin
unix_ts_ms = substring(int8send(floor(extract(epoch from clock_timestamp()) * 1000)::bigint) from 3);
@tuarrep
tuarrep / HomeView.vue
Last active December 27, 2023 15:52
Validation installation VueJs
<template>
<div class="p-12">
<ul role="list" class="grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3">
<li v-for="product in products" :key="product.id"
class="col-span-1 divide-y divide-gray-200 rounded-lg bg-white shadow">
<div class="flex w-full items-center justify-between space-x-6 p-6">
<div class="flex-1 truncate">
<div class="flex items-center space-x-3">
<h3 class="truncate text-sm font-medium text-gray-900">{{ product.title }}</h3>
<span
diff --git a/PKGBUILD b/PKGBUILD
index 35e2038..51f0dd8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -19,6 +19,7 @@ sha512sums=('146ad1301beb2f2348d2ddf8f53c235f67968e784ab7349bbb2d11044fca88d02b0
package() {
local _gemdir="$(ruby -e'puts Gem.default_dir')"
gem install --ignore-dependencies --no-user-install -i "$pkgdir/$_gemdir" -n "$pkgdir/usr/bin" $_gemname-$pkgver.gem
+ gem install --ignore-dependencies --no-user-install -i "$pkgdir/$_gemdir" -n "$pkgdir/usr/bin" faraday_middleware -v 0.9.1
rm "$pkgdir/$_gemdir/cache/$_gemname-$pkgver.gem"
<template>
<div class="hello">
<h1 @click="createSupplier">{{ msg }}</h1>
<h2 v-for="supplier in suppliers" :key="supplier.id">{{supplier.name}}</h2>
</div>
</template>
<script>
import axios from 'axios' // == const axios = require('axios')

Keybase proof

I hereby claim:

  • I am tuarrep on github.
  • I am mafzst (https://keybase.io/mafzst) on keybase.
  • I have a public key ASALqDSF7_VzpWPX0ueoqCfITIkU_9zn50HaTA2RRLjOjQo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am mafzst on github.
  • I am mafzst (https://keybase.io/mafzst) on keybase.
  • I have a public key ASAdcRrAW4Tdlc59ppNTFWv_-pM-uOR4s04eeY7o8ntofwo

To claim this, I am signing this object:

Verifying that "nicolasperraut.id" is my Blockstack ID. https://onename.com/nicolasperraut
{
"sodium": {
"serving": "0.627",
"unit": "g",
"100g": "0.196",
"value": "0.196"
},
"sugars": {
"value": "3.8",
"unit": "g",
"nutriments": {
"sodium": "0.192913385826772",
"sugars": "31",
"sugars_value": "31",
"fat_unit": "g",
"carbohydrates_unit": "g",
"proteins_unit": "g",
"fat": "15",
"nutrition-score-fr_100g": "17",
"carbohydrates_value": "71",
@tuarrep
tuarrep / valnutri-code.es6
Last active September 6, 2016 07:14
Déméler les valeurs nutritionnelles !
const keys = Object.keys(nutriments);
let parsed = {};
const primitives = keys
.filter((key) => key.split('_').length == 1);
primitives.forEach((key) => {
let secondaries = keys.filter((secondKey) => {
let splitted = secondKey.split('_');
return splitted.length == 2 && splitted[0] == key;