Skip to content

Instantly share code, notes, and snippets.

View gglanzani's full-sized avatar

Giovanni Lanzani gglanzani

View GitHub Profile
@gglanzani
gglanzani / opengraph.html
Created March 14, 2024 11:19
opengraph.html with hugo{
{{- if .IsPage }}
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
<meta property="article:section" content="{{ .Section }}" />
{{ with .PublishDate }}<meta property="article:published_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
{{ with .Lastmod }}<meta property="article:modified_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }}
{{- end -}}
{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }}
{{- with .Params.locale }}<meta property="og:locale" content="{{ . }}" />{{ end }}
{{- with .Site.Params.title }}<meta property="og:site_name" content="{{ . }}" />{{ end }}
@gglanzani
gglanzani / app.conf
Last active April 20, 2022 11:48
miniflux, docker-compose, nginx
server {
listen 80;
server_name <my_domain>;
server_tokens off;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gglanzani
gglanzani / gist:3224737
Created August 1, 2012 07:56
Export your collection of papers in Papers to BibTeX
-- the following variable allows to choose what we want to export
-- it can be "Selected Papers Only", "Selected Collection" or "Entire Library"
set myDesiredSaveRange to "Selected Collection"
-- the following variable allows is the path where we save the bib file
set myPath to "~/Desktop/from_papers.bib"
-- do we also have a prettifier?
set runPrettifier to true
-- path to it
"""
When deploying new jars used by NiFi's ExecuteScript processor, it is necessary to stop and restart all the
processors manually to have them pick up the new jars. This script solves this issue.
"""
import json
from urllib import request
from urllib import error
from typing import Dict, Iterator, List
from http.client import HTTPResponse
@gglanzani
gglanzani / index.html
Last active June 16, 2017 09:51
accelerator tshirt
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css">
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg)">
<scene id="scene1">
@gglanzani
gglanzani / .theanorc
Created October 3, 2016 07:41
Theano + CUDA on Windows
[general]
device=gpu
floatX=float32
[cuda]
root=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0
[nvcc]
compiler_bindir=C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin
[lib]
cnmem=0.2
(*
PapersToBibDesk: To transfer citations from Papers to formatlib and
auto-generate a citekey.
Place this in ~/Library/Scripts/Applications/Papers
Create this folder if necessary.
Select the references you wish to transfer in Papers first.
Then run the script.
@gglanzani
gglanzani / gsInstaller-9715.out
Created December 7, 2012 06:57
My gsInstaller log
===============================================================================
Grid Stack Installer
===============================================================================
===============================================================================
Installation Details
===============================================================================
===============================================================================
yum -y install pdsh
===============================================================================
Loaded plugins: priorities, security
@gglanzani
gglanzani / gsInstaller.properties
Created December 5, 2012 12:02
my gsInstaller.properties
#/**
#
#* Copyright 2011, Hortonworks Inc. All rights reserved.
#
#* Licensed under the Apache License, Version 2.0 (the "License");
#* you may not use this file except in compliance with the License.
#* You may obtain a copy of the License at
#
#* http://www.apache.org/licenses/LICENSE-2.0
#