Skip to content

Instantly share code, notes, and snippets.

View pdonadeo's full-sized avatar

Paolo Donadeo pdonadeo

View GitHub Profile
@pdonadeo
pdonadeo / listGoogleDriveSharedDocuments.js
Created July 15, 2021 08:43 — forked from JavierCane/listGoogleDriveSharedDocuments.js
Google Spreadsheet script that lists all the shared documents inside a specified folder and all its subfolders recursively. Skips out the documents shared internally (with specified email addresses)
function start() {
const sheet = SpreadsheetApp.getActiveSheet();
sheet.appendRow(["Name", "Sharing Access", "Sharing Permission", "Get Editors", "Get Viewers", "Date", "Size", "URL", "Download", "Description", "Type"]);
const folder = DriveApp.getFolderById("folder_id_copied_from_the_url_without_the_google_drive_domain");
recursiveListSharedFiles(folder, sheet);
}
function recursiveListSharedFiles(folder, sheet) {
@pdonadeo
pdonadeo / app-icons.json
Created October 13, 2019 10:04
i3bar configuration
[
{
"window_class": "gvim",
"fa_icon": "pen-nib"
},
{
"window_class": "telegramdesktop",
"fa_icon": "telegram"
},
{
#!/bin/bash
set -e
# FEATURES
# - Doesn't show the sink that is already the default
# - Automatically switches all running input sinks when switching the default sink
# Get the current default sink
SINK_DEFAULT=$(pactl info | ag "Default Sink" | ag -o "(?!.*:)[^\s].*")
@pdonadeo
pdonadeo / tree.json
Created September 2, 2019 15:07
Output of GET_TREE on i3 4.17
{
"border": "pixel",
"current_border_width": -1,
"deco_rect": {
"height": 0,
"width": 0,
"x": 0,
"y": 0
},
"floating": "auto_off",
@pdonadeo
pdonadeo / telegram_node.json
Created May 25, 2019 10:25
comparing output of `i3-msg` and `i3_msg`
{
"border": "pixel",
"current_border_width": 2,
"deco_rect": {
"height": 22,
"width": 564,
"x": 0,
"y": 44
},
"floating": "auto_off",
@pdonadeo
pdonadeo / sp
Last active June 10, 2018 09:25 — forked from wandernauta/sp
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/usr/bin/env bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
@pdonadeo
pdonadeo / compile.sh
Last active May 20, 2018 21:42
Bash script
#!/bin/bash
STD_LIB=`ocamlc -config | grep 'standard_library:' | gawk '{print $2}'`
LIBS=`dirname ${STD_LIB}`
INCLUDE_DIRS="-I ${LIBS}/result -I ${LIBS}/ppx_deriving -I ${LIBS}/lens"
PPX="${LIBS}/ppx_deriving/ppx_deriving ${LIBS}/lens/lens_ppx_deriving.cma"
ocamlc -c -g -annot -bin-annot -o hello_lens.cmi \
open ReasonReact;
open Utils;
type state = {
shown : bool,
value : string
};
let file_dialog = ReasonReact.reducerComponent("InputDialog");
@pdonadeo
pdonadeo / rev.ml
Created June 8, 2017 20:17
Example of reversing a list in OCaml
let rec rev ?(acc = []) xs =
match xs with
| hd::tl -> rev ~acc:(hd::acc) tl
| [] -> acc
@pdonadeo
pdonadeo / test_ssl4.ml
Created February 8, 2017 11:20
SSL Test (4)
open Core.Std
open Async.Std
open Async_ssl.Std
open Log.Global
open Re2.Std
(* ocamlbuild -use-ocamlfind -cflag -thread -lflag -thread -pkgs re2,async_ssl test_ssl4.native *)