Skip to content

Instantly share code, notes, and snippets.

View nicordev's full-sized avatar

Nicolas Renvoisé nicordev

View GitHub Profile
@nicordev
nicordev / whoHasTalked.js
Last active October 8, 2020 07:44
Google meet script to get a list of who has already talked during a daily meeting.
// ==UserScript==
// @name Who has talked?
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Show a list of attendees to see who has already talked. Click on a name to remove it. Double click on the list to remove the overlay.
// @author You
// @match https://meet.google.com/*
// @grant none
// ==/UserScript==
@nicordev
nicordev / Drew Stokes
Last active April 29, 2021 08:40
Bash arguments parsing snippet.
#!/bin/bashPARAMS=""while (( "$#" )); do
case "$1" in
-a|--my-boolean-flag)
MY_FLAG=0
shift
;;
-b|--my-flag-with-argument)
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
MY_FLAG_ARG=$2
shift 2
@nicordev
nicordev / database_drop_create_migrate_load.sh
Last active June 29, 2020 14:34
Symfony: doctrine commands
#!/bin/sh
php bin/console doctrine:database:drop --if-exists --force && \
php bin/console doctrine:database:drop --env=test --if-exists --force && \
php bin/console doctrine:database:create && \
php bin/console doctrine:migrations:migrate --no-interaction && \
php bin/console hautelook:fixtures:load --quiet
@nicordev
nicordev / git_switch_branch.php
Last active March 22, 2020 21:19
PHP script to switch git branch using a menu. Can also filter results by passing a parameter to the command.
#!/bin/php
<?php
function getGitBranches(?string $criteria = null)
{
if ($criteria) {
$branches = explode("\n", `git branch | grep {$criteria}`);
} else {
$branches = explode("\n", `git branch`);
}
@nicordev
nicordev / display.css
Created February 15, 2020 21:37
Display an element if you hover or tap on another element.
.switch-display
{
display: none;
}
.switch-display-trigger:hover .switch-display, .switch-display-trigger:focus .switch-display
{
display: inline;
}
@nicordev
nicordev / labyrinthe.js
Created December 18, 2019 20:45
blockly-games labyrinthe
while (notDone()) {
if (isPathLeft()) {
turnLeft();
moveForward();
} else {
if (isPathForward()) {
moveForward();
} else {
if (isPathRight()) {
turnRight();
@nicordev
nicordev / AppFixtures.php
Last active July 23, 2020 13:48
ApiPlatform & React formation - Fixtures refactoring for myself
<?php
namespace App\DataFixtures;
use App\Entity\Customer;
use App\Entity\Invoice;
use App\Entity\User;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager;
use Faker\Factory;
@nicordev
nicordev / password_hash.php
Created September 27, 2019 16:44
Hash a password using php in the command line
<?php
echo "Password: ";
fscanf(STDIN, "%s\n", $password);
echo "$password\nHash using password_hash() and PASSWORD_DEFAULT: ";
echo password_hash($password, PASSWORD_DEFAULT);
@nicordev
nicordev / intro.html
Last active September 16, 2019 20:23
Quick start guide for leaflet from leafletjs.com
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css"
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="