Skip to content

Instantly share code, notes, and snippets.

View pirafrank's full-sized avatar
🎯
Focusing

Francesco Pira pirafrank

🎯
Focusing
View GitHub Profile
@pirafrank
pirafrank / ios_scriptable_codespaces.js
Last active March 22, 2024 08:35
iOS Scriptable widget and table to summarize, list, start, and stop your GitHub Codespaces
// *********
// constants
// *********
// Go to GitHub > Settings > Developer Settings > Personal access tokens > Tokens
// and create a new one with the following scopes:
// - codespaces (Full control over codespaces)
// - read:user
// - user:email
const token = "ghp_123secretToken"

$argon2id$v=19$m=8192,t=2,p=4$Y+r8NKkXj0fRU5SXsnU5wQ$ElL+7Y53Kfl1537JUzTvl2h8FwCttAsX

@pirafrank
pirafrank / fix_outlook_copy_events.reg
Created December 6, 2023 13:10
A fix to restore Copy Calendar Events functionality in Microsoft Outlook 365 for Windows
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Options\Calendar]
"EnableMeetingCopy"=dword:00000001
@pirafrank
pirafrank / .EXIF_renamer.md
Last active June 9, 2023 19:30
exif_renamer - EXIF to filename

EXIF_renamer

rename your photos to their DateTimeOriginal datetime in EXIF metadata.

@pirafrank
pirafrank / Dockerfile
Created April 4, 2023 13:05
vim from jonathonf's PPA in a Docker container
FROM ubuntu:focal
ENV DEBIAN_FRONTEND=noninteractive
# explicitly set lang and workdir
ENV LANG="en_US.UTF-8" LC_ALL="C" LANGUAGE="en_US.UTF-8"
USER root
RUN apt-get remove -y vim-runtime gvim vim-tiny \
@pirafrank
pirafrank / get-lockscreen-wallpapers.ps1
Created January 18, 2022 14:04
Copy Windows 10 lockscreen background images to a subdir of YOURUSERNAME\Pictures. Subdir content will be replaced on each run.
Copy-Item -Force -Recurse $env:USERPROFILE\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets $env:USERPROFILE\Pictures\LockScreen_Wallpapers
Dir $env:USERPROFILE\Pictures\LockScreen_Wallpapers | rename-item -newname { [io.path]::ChangeExtension($_.name, "jpg") }
explorer $env:USERPROFILE\Pictures\LockScreen_Wallpapers
@pirafrank
pirafrank / aws_lambda_callback_redirect.js
Created January 13, 2022 19:57
callback function to make an HTTP redirect with AWS Lambda
callback(null, {
statusCode: 307,
headers: {
Location: 'https://github.com/pirafrank',
}
})
@pirafrank
pirafrank / tasks.json
Created December 18, 2021 02:10
VS Code tasks config for Jekyll
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Serve",
"type": "shell",
"command": "bundle exec jekyll s",
"problemMatcher": []
@pirafrank
pirafrank / run_other_teams.ps1
Created November 19, 2021 17:04
Powershell script to open another instance of Microsoft Teams desktop application. This script runs the app as another user, you need to create another local Windows user before running the script. Check the link the comments to find out how. Tested on Windows 10 and Microsoft Teams v1.4.00.29469 (64-bit, last updated on 11/19/2021)
# Read me:
#
# You need to do some setup before running this script.
# Check the link below.
#
# Run this script as admin in powershell.
# By the way if you run it in a standard powershell it will
# prompt to open a new shell as admin.
#
@pirafrank
pirafrank / checkrun.sh
Created October 18, 2021 13:08
checkrun - a function to get try-catch in bash
function checkrun {
if [ $1 -ne 0 ]; then
echo "$2"
exit 2
fi
}
function test1 {
echo "test1" && \
echo "print 2"