Skip to content

Instantly share code, notes, and snippets.

View audrenbdb's full-sized avatar

Audren Bouëssel du Bourg audrenbdb

  • France
View GitHub Profile
@audrenbdb
audrenbdb / minificator.sh
Created June 24, 2024 19:33
Minify contents of images in a folder
#!/bin/bash
# Requirements (macos)
# brew install imagemagick
# brew install jpegoptim
# brew install optipng
# Check if both arguments are provided
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <source_folder> <destination_folder>"
{"schemaVersion":1,"label":"coverage","message":"39.1%","color":"green"}
{"schemaVersion":1,"label":"coverage","message":"84.6%","color":"green"}
package main
import (
"context"
"fmt"
"log"
"time"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
package repository
import (
"context"
"github.com/ramadoiranedar/go_restapi/model/domain"
)
type CategoryRepository interface {
Create(ctx context.Context, category domain.Category) domain.Category
Update(ctx context.Context, category domain.Category) domain.Category
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
const withPlugins = require('next-compose-plugins')
// at the moment the application version refers to git commit
const revision = require('child_process')
.execSync('git rev-parse HEAD')
.toString().trim()
@audrenbdb
audrenbdb / index.html
Last active December 8, 2021 07:05
Minimum OAuth2 local client
<!DOCTYPE html>
<html>
<body>
<a
href="http://localhost:9096/oauth/authorize?client_id=paulthebest&redirect_uri=http://localhost:8080/oauth/redirect&response_type=code">
Login
</a>
</body>
</html>
package main
import (
"fmt"
"log"
"os/exec"
"syscall"
"time"
"unsafe"
)
package main
import "strconv"
//solveFizzBuzz solves Fizzbuzz algorithm with given rules below :
//https://en.wikipedia.org/wiki/Fizz_buzz
//Count incrementally up to n :
//when a number is divisible by 3 replace it with Fizz
//when its divisible by 5 replace it with Buzz
//when its divisible by 5 AND 3 replace it with FizzBuzz
/* calculator in javascript using functional programming principles */
const operators = ["+", "*", "-", "/"];
//isOperator checks if a given character is an operator
const isOperator = char => operators.includes(char);
/* all operations to be used */
const operations = {
"/": (a, b) => a / b,
"*": (a, b) => a * b,