Skip to content

Instantly share code, notes, and snippets.

View benkio's full-sized avatar
🤘

Enrico Benini benkio

🤘
View GitHub Profile
#!/usr/bin/env scala-cli
// to import stuff
// using lib "com.lihaoyi::os-lib:0.7.8"
// args is the command line input
using lib "org.typelevel::cats-effect:3.3.12"
import cats.effect._
import sys.process._
import java.net.URL
@benkio
benkio / youtubeToGifVideoAudio.sc
Last active January 16, 2024 15:17
youtube video to gif, video and audio
#!/usr/bin/env scala-cli
// to import stuff
//> using dep "com.lihaoyi::os-lib:0.9.3"
// args is the command line input
import java.nio.charset.StandardCharsets
import scala.io.StdIn.readLine
import scala.concurrent.duration._
// Prerequisites:
// - ffmpeg
#!/usr/bin/env scala-cli
// to import stuff
// using lib "com.lihaoyi::os-lib:0.7.8"
// args is the command line input
using lib "org.typelevel::cats-core:2.7.0"
import cats.data.{StateT, NonEmptyList}
import cats.syntax.all._
import java.time.LocalTime
@benkio
benkio / hangman.sc
Last active February 14, 2022 21:38
Hangman Game Example in Scala
#!/usr/bin/env scala-cli
// to import stuff
// using lib "com.lihaoyi::os-lib:0.7.8"
// args is the command line input
using lib "org.typelevel::cats-core:2.7.0"
using lib "org.typelevel::cats-effect:3.3.5"
import cats.data.StateT
import scala.io.StdIn._
@benkio
benkio / convertFilms.sc
Last active March 16, 2024 19:12
Convert FFMpeg commands for scaub lorenz tv
#!/usr/bin/env scala-cli
// to import stuff
//> using dep "com.lihaoyi::os-lib:0.9.3"
//> using dep "org.scala-lang.modules::scala-parallel-collections:1.0.4"
// args is the command line input
import scala.collection.parallel.CollectionConverters._
import scala.collection.parallel._
val endingPath = os.home/"temp"/"convertedFilms"
def tempPath(inputFile:String) =
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
cup all -y
$packages = "ccleaner", "youtube-dl", "xsltproc", "nodejs.install", "purescript", "javaruntime", "7zip", "vlc", "git", "ubuntu.font", "dotnetfx", "wget", "emacs", "gimp", "cygwin", "calibre", "curl", "ffmpeg", "pandoc", "f.lux", "scala", "sbt", "filezilla", "telegram", "directx", "teamviewer.host", "tixati", "discord", "battle.net", "imagemagick", "hexchat", "sumatrapdf", "firefox", "jdk8", "urban-terror", "ag", "lilypond"
Foreach ($package in $packages){
cinst $package -y
}
New-Item -ItemType directory -Path .\workspace
#!/bin/sh
##########################################################################################################################################################################################
# GIT PREPARATION TOOL #
# bash script useful to setup the git tool. This script will: #
# - Ask the user to fill name and email, then set the identity on git. #
# - Download a specific git hooks, see the url (https://gist.github.com/bartoszmajsak/1396344/raw/prepare-commit-msg.sh) WARNING: previous hook will be replaced #
# used for prepend to every commit the name of the branch (excluding devel
#!/bin/bash
#############################################################
## SOFTWARE FOR RASPBERRY STARTING FROM RASPBIAN #
#############################################################
sudo apt-get update
sudo apt-get -y remove bluej libreoffice greenfoot wolfram-engine dillo scratch idle3 idle python-pygame libraspberrypi-doc sonic-pi minecraft-pi sense-hat geany
//////////////////////////////////////////////////////////////////////////////////////////
// FSTAB
//////////////////////////////////////////////////////////////////////////////////////////
UUID=16059E8B375E207C /media/pi/BenkioHD2 ntfs-3g auto,users,permissions,nofail,_netdev 0 0
UUID=34A1923762350DD2 /media/pi/BenkioHD1 ntfs-3g auto,users,permissions,nofail,_netdev 0 0
UUID=F8508CE6508CAD46 /media/pi/HD\040Esterno ntfs-3g auto,users,permissions,nofail,_netdev 0 0
UUID=ad086b03-7a1f-44d1-b00d-0dbf607ef96a /media/pi/RaspData2 ext4 rw,defaults,nofail,_netdev 0 0
UUID=b8377a35-e385-4d5a-b5e9-6156be29f28b /media/pi/RaspData ext4 rw,defaults,nofail,_netdev 0 0
@benkio
benkio / .spacemacs
Last active June 18, 2018 11:00
my spacemacs
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory