Skip to content

Instantly share code, notes, and snippets.

View midir99's full-sized avatar
๐ŸŒš
Hi!

midir99 midir99

๐ŸŒš
Hi!
View GitHub Profile
@midir99
midir99 / setup-ubuntu-vps.md
Last active March 13, 2026 16:15
Set up Ubuntu VPS

Set up Ubuntu VPS

These are some steps that I follow when I provision a small VPS for myself.

1. Add my user

I SSH into the VPS and add my user.

NEW_USER=midir99
@midir99
midir99 / consume_json_apis.rb
Last active March 13, 2026 15:24
Consume JSON API with Ruby without 3rd party libraries
require 'json'
require 'net/http'
require 'uri'
# Calls a JSON API via GET request, if the response status code is successful the JSON response body is parsed and returned as a hash.
def http_get_json(url, headers={}, open_timeout: 5, read_timeout: 10)
uri = URI.parse(url)
http = Net::HTTP::new(uri.host, uri.port)
http.use_ssl = (uri.scheme == "https")
@midir99
midir99 / install-my-neovim.sh
Last active July 5, 2023 18:29
Set up Neovim the way I like it!
#!/usr/bin/env bash
cat <<"END"
You are about to set up Neovim using midir99's installation script, the following
plugins are included:
- bluz71/vim-nightfly-guicolors
Used for the color schemes.
- nvim-lua/plenary.nvim