Skip to content

Instantly share code, notes, and snippets.

View ikosmidis's full-sized avatar

Ioannis Kosmidis ikosmidis

View GitHub Profile
@ikosmidis
ikosmidis / llama2-mac-gpu.sh
Created July 21, 2023 14:53 — forked from adrienbrault/llama2-mac-gpu.sh
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM
# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
wget "https://huggingface.co/TheBloke/Llama-2-13B-chat-GGML/resolve/main/${MODEL}"
@ikosmidis
ikosmidis / get_meeting_slots.R
Last active April 20, 2020 10:23
Get meeting slots from session dates, session start times, session end times and number of slots per session
## Author: Ioannis Kosmidis
## Version: 0.2
## Date: 20 April 2020
## NOT A POLISHED PIECE OF PUBLIC-USE SOFTWARE! Provided "as is".
## NO WARRANTY OF FITNESS FOR ANY PURPOSE!
#' Get meeting slots from a vector of session dates, session start times, session
#' end times and number of slots per session
@ikosmidis
ikosmidis / whiteboardCleaner.md
Created May 23, 2018 10:42 — forked from lelandbatey/whiteboardCleaner.md
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@ikosmidis
ikosmidis / let_it_snow.R
Last active December 25, 2017 09:32
A function to create artifical snow using R base graphics and the animation package
## Licence: GPL 2 or 3 <https://www.gnu.org/licenses/licenses.html#GPL>
## Author: Ioannis Kosmidis <i.kosmidis@ucl.ac.uk>
## Date: 21 December 2017
#' A function to create artifical snow using R base graphics and the animation package
#'
#' @param n_flakes how many flakes to throw?
#' @param fall_speed how fast should the snow fall? There will be a \code{1/fall_speed} seconds delay between moves
#' @param max_flake_size what is the maximum flake size (same as cex in \code{\link{plot}})
#' @param eps how much is the flake allowed to move to the left and to the right? (emulating wind)