Skip to content

Instantly share code, notes, and snippets.

View giuliobosco's full-sized avatar

Giulio Bosco giuliobosco

View GitHub Profile
@giuliobosco
giuliobosco / markdown-hf-samt.txt
Last active February 6, 2019 10:02
SAMT Header and Footer in markdown for atom.io markdown-themeable-pdf
Using markown in SAMT (Scuola Arti e Mestieri Trevano)
Instal the package atom package markdown-themeable-pdf, then open the folder of the package:
~/.atom/markdown-themeable-pdf/
And copy inside your logo (must be a square logo)
Then open the file "header.js" in the markdown-themeable-pdf foler and set the "height" to "2cm" and the "contents" to:
<div style="margin:0;"><div style="float:left;border:1px solid black;padding:2px 2px 0 2px;height:35px;z-index:1;background-color:white;"><img src="samt.png" style="width:33px"></div><div style="float:right;border:1px solid black;padding:4px 4px 0 4px;height:33px;font-size:11px;text-align:center;z-index:1;background-color:white;color:black;">Pagina:<br>{{page}} / {{pages}}</div><div style="overflow:auto;border-top:1px solid black;border-bottom:1px solid black;padding:2px 4px 2px 0;height:33px;font-size:11px;"><div style="width:100%;text-align:center;"><span style="color:black;">SAMT - Sezione Informatica</span><br><div style="width:100%;border-top:1px solid black
@giuliobosco
giuliobosco / StaticAbstract.java
Created October 1, 2019 13:02
Call B.m() from C.main() and it should print "content"
// The idea is of call B.m() from C.main() and it should print "content"
// Calling B.m() from B.main() works correctly but Calling it from C.main() doesn't works...
public abstract class A {
public static void m() {
StackTraceElement[] elements = Thread.currentThread().getStackTrace();
StackTraceElement element = elements[elements.length - 1];
try {
Class classe = Class.forName(element.getClassName());
System.out.println(classe.getField("ATTR").get(classe));
#!/bin/zsh
# v0.1
d=`date +%Y%m%d`;
git branch ng_build_${d}
git checkout ng_build_${d}
ng build
git add .
git commit -m "save ng development ${d}"
git push --set-upstream origin ng_build_${d}
@giuliobosco
giuliobosco / gist:132de016e0cb2cea17de01e641919fdd
Created October 31, 2020 18:13
cli_print_stormit_logs.go
package main
/*
realy bad code, to rewrite
*/
import (
"encoding/json"
"fmt"
"io/ioutil"
@giuliobosco
giuliobosco / stormkit-cli.md
Last active November 1, 2020 21:26
stormkit-cli.md

stormkit-cli

Manage applications:

$ sk app ls [--numbers] [--details]
$ sk app add <repo>|.
$ sk app rm <id>|--repo <repo>|--index <index>|.
$ sk app use <id>|--repo <repo>|--index <index>|.
$ sk app info [<id>|--repo <repo>|--index <index>|.] [--get...|--set...] ## configure app settings

Keybase proof

I hereby claim:

  • I am giuliobosco on github.
  • I am giuliobosco (https://keybase.io/giuliobosco) on keybase.
  • I have a public key ASAKG5NmOm-XsIoiLVuCxE-6burSUuPhWloK2jwLpvWimwo

To claim this, I am signing this object:

@giuliobosco
giuliobosco / photo.sh
Last active March 2, 2022 06:51
macOS rename photos in folder for with photo shooting date
#!/bin/bash
for filename in $(pwd)/*; do
line=$(mdls $filename | grep kMDItemFSCreationDate)
fileExtension=$(echo $filename | cut -f2 -d".")
datetime=$(echo $line | cut -f2 -d "=")
date=$(echo $datetime | cut -f1 -d " ")