Skip to content

Instantly share code, notes, and snippets.

View Kerruba's full-sized avatar
♥️

Luca Cherubin Kerruba

♥️
  • Milkman Technologies
  • Padova - IT
View GitHub Profile
@Kerruba
Kerruba / jhipster_file_template_docs.md
Last active August 28, 2020 15:07
Documentation about JHipster files template

JHipster file templates documentation

Here some documentation I created to better understand the content of the files.js in JHipster generators

File template overview

This is an example of a file object. Each file object has:

  • condition: is a function of the generator that is used to check if the file(s) has to be created
  • path: is the base path where the file has to be found from the generator
  • template: could either be a string or an object. Usually it's a string, and this implies that the path reference an ejs template and the method to use is template.
@Kerruba
Kerruba / biosamples-json-schema.json
Created July 12, 2018 17:52
biosamples-v4 json-schema
[{
"$schema": "http://json-schema.org/draft-07/schema#",
"id": "http://www.ebi.ac.uk/biosamples/0.0.1/sample",
"additionalProperties": false,
"required": [
"name",
"accession"
],
"type": "object",
"properties": {
# -*- coding: utf-8 -*-
# Print iterations progress
def print_progress(iteration, total, prefix='', suffix='', decimals=1, bar_length=100):
"""
Call in a loop to create terminal progress bar
@params:
iteration - Required : current iteration (Int)
total - Required : total iterations (Int)
prefix - Optional : prefix string (Str)
@Kerruba
Kerruba / bash-try-catch.sh
Created March 15, 2017 12:07 — forked from stepf/bash-try-catch.sh
Try-Catch Behavior in Bash
#!/bin/bash --
# Note -- will make script continue despite errors
echo "Some command that fails"
RETURN_CODE=$?; #capture error code here (if any)
echo "Cleanup before script is allowed to fail"
[[ $RETURN_CODE -ne 0 ]] && exit $RETURN_CODE
#!/usr/bin/env bash
origin=("${@: 1:$#-1}")
dest=${@: -1}
echo "Process started"
head -n 1 ${origin[0]} > ${dest}
echo "Combining files"
for f in ${origin[@]}
@Kerruba
Kerruba / .cvimrc
Last active February 14, 2017 09:37
cvim config
" Settings - Mouseless
set barposition "bottom"
set nosmoothscroll
set noautofocus " The opposite of autofocus; this setting stops
" sites from focusing on an input box when they load
set typelinkhints
let searchlimit = 30
let scrollstep = 70
let barposition = "bottom"
let mouselesshintcharacters = "1234"