Skip to content

Instantly share code, notes, and snippets.

View nicordev's full-sized avatar

Nicolas Renvoisé nicordev

View GitHub Profile
@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 / 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 / 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 / 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==