Skip to content

Instantly share code, notes, and snippets.

Avatar

Victor Veytsman vityavv

View GitHub Profile
@vityavv
vityavv / uploadToS3.sh
Created Mar 22, 2020
Upload what's in the clipboard to S3 (interactive file name input)
View uploadToS3.sh
#!/usr/bin/env bash
BUCKET="vityavv-imagebin"
target=$(xclip -sel clip -o -t TARGETS | tail -1)
mime="$target"
[[ "$mime" == *"/"* ]] || mime="text/plain"
filename=$(yad --entry --title "S3 Uploader" --center --text "S3 Uploader\nClipboard type is $target" --text-align=center --entry-label="Filename:" 2>/dev/null || echo "STOP THIS")
[ "$filename" == "STOP THIS" ] && exit 1
@vityavv
vityavv / decksToQuizlet.js
Last active Jan 13, 2020
This script translates a decks.memrise list to a format you can import into quizlet. To use it, paste it into the browser console of a decks list page, and copy the result into quizlet's import!
View decksToQuizlet.js
Array.from(document.querySelectorAll("div.things.clearfix .text-text .text .text")).map(e=>e.textContent).reduce((a,b)=>(a[a.length-1].length<2?a[a.length-1].push(b):a.push([b]),a),[[]]).map(e=>e.join(" ")).join("\n")
@vityavv
vityavv / copypasta.sh
Created Jan 5, 2020
A program that'll help you with copypastas using rofi
View copypasta.sh
# Made by Victor Veytsman
# Usage: have a copypastas.txt file with your copypastas.
# Separate your copypastas with three equal signs
# Separate the name of the copypasta and the text with three semicolons
# Make this file executable and bind it to some keybinding
getList() {
grep -o '^.*;;;' copypastas.txt | sed 's/...$//g'
}
@vityavv
vityavv / _about.md
Last active Dec 2, 2019
An Advent of Code light theme
View _about.md

AOC light theme

This is a light theme for advent of code. style.css contains the style. bookmarklet.html can be visited with rawgit (that's the direct link to bookmarklet.html) to find a bookmarklet that can be dragged to your bookmarks bar and then pressed to make the AOC webpage light.

@vityavv
vityavv / imagerandvoronoi.go
Last active Mar 16, 2019
Program creates a voronoi diagram using random sites, then colors in each site with the average color of all of the pixels contained in the site. https://blog.victor.computer/article/3
View imagerandvoronoi.go
package main
import (
"math/rand"
"image/draw"
"image/png"
"image/color"
"strconv"
"os"
"time"
@vityavv
vityavv / .vimrc
Created Dec 8, 2018
My current vimrc
View .vimrc
" Get the defaults that most users want.
source $VIMRUNTIME/defaults.vim
" Set colors be good
set termguicolors
colorscheme gruvbox
set background=dark
set cursorline
" Set search to highdark incomplete, case insensitive, highlight
set hls is ic
set number relativenumber
@vityavv
vityavv / aoc.js
Created Dec 2, 2018
Advent of Code 2018... GOLFED!
View aoc.js
// This is my list of solutions to the Advent of Code challanges
// They are written in JavaScript, with the goal of getting the
// size of them to be as small as possible.
// Each one assumes that the variable y is an array of the body's
// contents. You can get that by doing the following in the
// browser console of the input:
y=document.body.innerText.split("\n")
// The documents may have a trailing newline, but you can do this
// to solve that
y=y.slice(0,y.length-1)
@vityavv
vityavv / info.md
Created May 11, 2018
A chat server with node's net module.
View info.md

How to use

Run the file. The port is on the last line (no. 13) so you can change that.

In another terminal, on the local network or on the same computer, type nc <local IP of server (or localhost)> <port (default 9000>. Then, you can type stuff to send it, and type /nick <nickname> to set your nickname. You can connect with as many terminals as you want. You can also port-forward that port to be able to access the chat room outside of the local network.

Great!

You can’t perform that action at this time.