This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function main(workbook: ExcelScript.Workbook) { | |
// Specify the sheet names | |
let mainSheetName = "System Items"; | |
let lookupSheetName = "Foglio1"; | |
// Get the sheets | |
let mainSheet = workbook.getWorksheet(mainSheetName); | |
let lookupSheet = workbook.getWorksheet(lookupSheetName); | |
// Get used ranges (assuming data starts from row 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function main(workbook: ExcelScript.Workbook) { | |
// Specify the worksheet name | |
let worksheetNameS = "Foglio2"; // Adjust the sheet name as necessary | |
let worksheetS = workbook.getWorksheet(worksheetNameS); | |
// Specify the worksheet name | |
let worksheetNameD = "Foglio1"; // Adjust the sheet name as necessary | |
let worksheetD = workbook.getWorksheet(worksheetNameD); | |
// Starting and ending cells in the column containing the range addresses |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// xcrun -sdk macosx swiftc pbpaste.swift -o pbpaste-html | |
// from: http://stackoverflow.com/questions/17217450/how-to-get-html-data-out-of-of-the-os-x-pasteboard-clipboard | |
import Cocoa | |
let type = NSPasteboardTypeHTML // PNG for image | |
if let string = NSPasteboard.generalPasteboard().stringForType(type) { | |
print(string) | |
} | |
else { | |
print("Could not find string data of type '\(type)' on the system pasteboard") | |
exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#1) on https://console.developers.google.com/ register project and associate API from library | |
# OUTPUT: client_id,client_secret | |
client_id="..." | |
client_secret="...." | |
#2) get authorization code at the following link using web browser | |
# OUTPUT: code | |
scope="https://www.googleapis.com/auth/drive" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Reading video from FFMPEG using subprocess - aka when OpenCV VideoCapture fails | |
# | |
# 2017 note: I have realized that this is similar to moviepy ffmpeg reader with the difference that here we support YUV encoding | |
# BUT we lack: bufsize in POpen and creation flags for windows | |
# https://github.com/Zulko/moviepy/blob/master/moviepy/video/io/ffmpeg_reader.py | |
# | |
# Emanuele Ruffaldi 2016 | |
import cv2 | |
import subprocess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=LAMBDA(r,p,y,ARCCOS((COS(p)*COS(r)+COS(p)*COS(y)+COS(y)*COS(r)+SEN(p)*SEN(r)*SEN(y)-1)/2))(A3,B3,C3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Dependencies: curl gcc make autoconf | |
# | |
# Changes: 2024-01-03 Emanuele Ruffald | |
# Updated to latest libraries, modified for building openssh, added some if for debugging | |
set -uex | |
umask 0077 | |
ZLIB_VERSION=1.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run command Open Keyboard Shortcuts (JSON) | |
// AltGr+ì is oem_6 ==> use Open Keyboard Shortcuts , select record key and press the shortcut | |
[ | |
{ "key": "oem_6", | |
"command": "editor.action.insertSnippet", | |
"when": "editorTextFocus", | |
"args": { | |
"snippet": "~" | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <functional> | |
#include <fstream> | |
#include <iostream> | |
#include <signal.h> | |
/// one holder per signal type | |
template <int q> | |
struct Signal | |
{ | |
using sfx = void(int ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from csv import DictReader,DictWriter | |
# originally from pygramel | |
class TypedDictReader(DictReader): | |
"""A class for iterating a CSV file and type cast the values.""" | |
def __init__(self, csvfile, casts, fieldnames=None, restkey=None, | |
restval=None, dialect='excel', *args, **kwds): | |
"""Arguments: | |
- f: An iterable object such as as file. Passed on to |
NewerOlder