Skip to content

Instantly share code, notes, and snippets.

View benjaminbrassart's full-sized avatar

Benjamin Brassart benjaminbrassart

View GitHub Profile
@benjaminbrassart
benjaminbrassart / c.json
Created April 13, 2022 00:31
vscode include guard snippet for c/c++
{
"Include guard": {
"prefix": "include-guard",
"body": [
"#ifndef ${TM_FILENAME_BASE/(.*)/${1:/upcase}/}_H",
"# define ${TM_FILENAME_BASE/(.*)/${1:/upcase}/}_H",
"",
"${0}",
"",
"#endif"
@benjaminbrassart
benjaminbrassart / c.json
Created December 15, 2021 01:03
42 include guard snippet
{
"Include guard": {
"prefix": "include-guard",
"body": [
"#ifndef ${TM_FILENAME_BASE/(.*)/${1:/upcase}/}_H",
"# define ${TM_FILENAME_BASE/(.*)/${1:/upcase}/}_H",
"",
"$1",
"",
"#endif"
@benjaminbrassart
benjaminbrassart / norminette.sh
Last active November 19, 2021 04:24
Colored output and open file at line:column in VS Code for 42 norminette
#!/usr/bin/env sh
RED=$(tput setaf 1)
YELLOW=$(tput setaf 3)
RESET=$(tput init)
if ! type norminette > /dev/null 2>&1; then
echo "norminette not found"
exit 1
fi
@benjaminbrassart
benjaminbrassart / launch.json
Created November 6, 2021 13:28
Visual Studio Code tasks and debug config files
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
@benjaminbrassart
benjaminbrassart / monitoring.sh
Last active July 25, 2021 20:23
born2beroot monitoring script
#!/bin/bash
# **************************************************************************** #
# #
# ::: :::::::: #
# monitoring.sh :+: :+: :+: #
# +:+ +:+ +:+ #
# By: bbrassar <bbrassar@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/07/25 12:50:16 by bbrassar #+# #+# #
#!/bin/sh
set -ex
DISCORD_VERSION='0.0.31'
TAR_NAME="$(mktemp)"
# change this as you need
INSTALL_DIR="/sgoinfre/goinfre/Perso/${USER}/Discord"
INSTALL_DATE="$(date)"
autoload -Uz compinit
compinit
autoload -Uz vcs_info
precmd() {
vcs_info
}
PROMPT_COLOUR=#114dd8
BRANCH_COLOUR=#11b0d8
call plug#begin('~/.vim/plugged')
Plug 'pbondoer/vim-42header', { 'do': 'sed -i -- /^nmap/d after/plugin/42header.vim' }
Plug 'preservim/nerdtree'
Plug 'vim-airline/vim-airline'
Plug 'tpope/vim-fugitive'
Plug 'RRethy/vim-hexokinase'
Plug 'dense-analysis/ale'
"Themes
Plug 'ayu-theme/ayu-vim'
call plug#end()
@benjaminbrassart
benjaminbrassart / JSONView Dark+ theme
Last active June 1, 2020 17:37
Visual Studio Code's Dark+ theme ported for JSONView Chrome webstore extension
body {
white-space: pre;
font-family: consolas;
font-size: 1rem;
color: white;
background: #1d1d1d;
}
.property {
color: #9cdcfe;
package fr.harmoniamc.api.bukkit.util;
import fr.harmoniamc.api.core.util.HarmoniaUtils;
import org.bukkit.Sound;
/**
* An enum class to use both prior and since 1.9 Bukkit sounds
* @see org.bukkit.Sound
*/
public enum SoundSupport {