Skip to content

Instantly share code, notes, and snippets.

View Vulwsztyn's full-sized avatar
:octocat:

Artur Mostowski Vulwsztyn

:octocat:
  • Poznań
  • 09:38 (UTC +01:00)
View GitHub Profile
@Vulwsztyn
Vulwsztyn / user-abbreviations
Created July 1, 2024 14:55
Paste to .config/zsh-abbr
abbr "drut"="docker container run -it -v $(pwd):/app -w /app"
abbr "vsc"="code ."
abbr "l"="exa -lag --header"
abbr "h"="history"
abbr "gcme"="git commit -m"
abbr "gs"='git push origin "$(git_current_branch)"'
abbr "gsf"='git push origin "$(git_current_branch)" --force'
@Vulwsztyn
Vulwsztyn / pptx_to_pdf.ps1
Created June 22, 2023 14:21
Script converting all pptx in dir to pdf
# Load the PowerPoint assembly
Add-Type -AssemblyName Microsoft.Office.Interop.PowerPoint
# Create a PowerPoint application object
$powerpoint = New-Object -ComObject PowerPoint.Application
# Disable alerts and visibility
$powerpoint.DisplayAlerts = [Microsoft.Office.Interop.PowerPoint.PpAlertLevel]::ppAlertsNone
# $powerpoint.Visible = $false
@Vulwsztyn
Vulwsztyn / musixmatch_api_example.ts
Created March 25, 2023 13:55
Musixmatch API example TS
import axios from 'axios'
import * as R from 'ramda'
const apikey = '<musixmatch_api_key>'
const main = async (track: string, artist: string) => {
const link = `https://api.musixmatch.com/ws/1.1/matcher.track.get?q_track=${track}&q_artist=${artist}&apikey=${apikey}`
const response = await axios.get(link)
console.log(JSON.stringify(response.data))
const track_id = R.pathOr(null, ['message', 'body', 'track', 'track_id'], response.data)
const link2 = `https://api.musixmatch.com/ws/1.1/track.lyrics.get?track_id=${track_id}&apikey=${apikey}`
def a(param=[]):
param.append(1)
print(param)
a()
a()
a()
#include <iostream>
using namespace std;
bool isEven(int number) {
if (number < 0) return isEven(-number);
if (number == 0) return true;
return !isEven(number - 1);
}
#include <iostream>
using namespace std;
bool isEven(int &number) {
if (number < 0) number = -number;
if (number == 0) return true;
number--;
return !isEven(number);
}
@Vulwsztyn
Vulwsztyn / instructions.md
Last active November 27, 2024 03:43
wsl2, zsh, oh-my-zsh, oh-my-posh setup instructions

WSL

  1. Download Ubuntu 20.04 LTS from Microsoft Store
  2. Turn Windows features on or off check Windows Subsystem for Linux (on the bottom)

ZSH

  1. sudo apt install zsh -y
  2. chsh -s $(which zsh)

Oh My Zsh

  1. sudo apt install git -y && sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  2. git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  3. git clone https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting