Skip to content

Instantly share code, notes, and snippets.

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

midir99 midir99

๐ŸŒš
Hi!
View GitHub Profile
@midir99
midir99 / gist.rb
Created February 12, 2026 21:54
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