Skip to content

Instantly share code, notes, and snippets.

View diogotito's full-sized avatar

Diogo Tito Victor Marques diogotito

View GitHub Profile
@diogotito
diogotito / dabblet.css
Created December 14, 2013 23:09
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body{
background: #f06;
background: linear-gradient(45deg, #002, #125);
min-height: 100%;
}
@keyframes girar_a_lua {
@diogotito
diogotito / abra-hs-webdriver-play.hs
Created February 8, 2018 04:14
Play a round at abra.pineman.win
{-# LANGUAGE OverloadedStrings #-}
import Test.WebDriver
import Test.WebDriver.Commands.Wait
import Test.WebDriver.Session
import Data.Text.IO
import qualified Data.Text as T
import qualified Data.Text.IO
import Control.Monad
import Control.Monad.Trans

Keybase proof

I hereby claim:

  • I am diogotito on github.
  • I am diogotito (https://keybase.io/diogotito) on keybase.
  • I have a public key ASBs-dO0OlFHTP-IzFHQZJem14oJTypJEmGrGsGeRwocJAo

To claim this, I am signing this object:

@diogotito
diogotito / StopThymio.ahk
Last active April 28, 2019 17:22
An AutoHotKey script to bind F8 to a click in the "Stop Thymio" button in Aseba Studio.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance force
#If WinActive("ahk_exe " "asebastudio.exe")
F8::
WinGetPos, WinX, WinY, WinW, WinH
MouseGetPos, x, y
@diogotito
diogotito / html-to-zim.ps1
Last active February 4, 2022 15:03
A PowerShell Custom Tool to paste HTML fragments into Zim
$ofs = "`n"
$clipboard = Get-Clipboard -TextFormatType Html
$html_fragment = ("$clipboard" -split '<!--StartFragment-->|<!--EndFragment-->')[1]
$html_fragment | pandoc --from html --to zimwiki
@diogotito
diogotito / 7z_to_efu.py
Last active June 22, 2022 23:40
Make an Everything File List from 7z output
from collections import namedtuple
from csv import DictWriter
from datetime import datetime
SEVENZ_OUTPUT = "7z_output.txt" # Name of file with `7z l <FILE> -slt` output
EFU_FILENAME = "7z_filelist.efu" # Name of Everything File List to write
conv = namedtuple("conversion", ("efu_column", "fn"))
pass_fn = lambda x: x
date_fn = lambda dt: datetime.strptime(dt, "%Y-%m-%d %H:%M:%S").isoformat()
@diogotito
diogotito / zip_all_revisions.js
Last active May 11, 2022 11:47
Google Apps Script to zip all revisions of all files in a directory and put it somewhere
// Drive service needed (in the sidebar, click the "+" next to "Services", select "Drive", then click "Add")
// To get a folder/file ID: Right click on Drive, Get link, manually copy the last part
const FOLDER_TO_BACKUP_ID = ScriptProperties.getProperty("Source Folder ID") || "... default folder ID ..."
const FOLDER_DEST_ID = ScriptProperties.getProperty("Dest Folder ID") || "... default folder ID ..."
const ZIP_NAME = "SOMETHING_backups.zip"
function zipAllFileVersionsInDirectory() {
let myFolder = DriveApp.getFolderById(FOLDER_TO_BACKUP_ID)
@diogotito
diogotito / markdown_link.user.js
Last active October 6, 2022 14:31
Userscript to link to open tab tab page in Markdown or Zimwiki markup syntax, through a menu command or the 'ctrl-alt-c m' and 'ctrl-alt-c z' keyboard shortcuts
@diogotito
diogotito / package_managers_search.ps1
Last active February 1, 2024 13:56
Search winget, Scoop and Chocolatey simultaneously in Windows Terminal with `pkg <search terms>` in PowerShell
# Search winget, Scoop and Chocolatey simultaneously in Windows Terminal
function pkg([string] $name) {
function Build-SearchCmd([string] $cmd) {
"C:\Windows\system32\cmd.exe", "/C", (@("ECHO ^> $cmd", "$cmd", "PAUSE") -join ' & ')
}
wt split-pane --vertical --size 0.5 (Build-SearchCmd "winget search $name") `; `
split-pane --horizontal --size 0.66 (Build-SearchCmd "scoop search $name") `; `
split-pane --horizontal --size 0.5 (Build-SearchCmd "choco search $name") `; `
focus-pane --target 0
<style>
.PageTransitionLinkTitle,
.PageTransitionLinkTitle_hover {
font: xx-large sans-serif;
color: blue;
text-decoration: underline;
cursor: pointer;
}
.PageTransitionLinkTitle_hover {