Skip to content

Instantly share code, notes, and snippets.

View alancriaxyz's full-sized avatar
🥷

Alan Alves alancriaxyz

🥷
View GitHub Profile
@joelonsql
joelonsql / PostgreSQL-EXTENSIONs.md
Last active May 18, 2024 12:22
1000+ PostgreSQL EXTENSIONs

🗺🐘 1000+ PostgreSQL EXTENSIONs

This is a list of URLs to PostgreSQL EXTENSION repos, listed in alphabetical order of parent repo, with active forks listed under each parent.

⭐️ >= 10 stars
⭐️⭐️ >= 100 stars
⭐️⭐️⭐️ >= 1000 stars
Numbers of stars might not be up-to-date.

@jeb5
jeb5 / Youtube Subs to OPML.js
Last active April 16, 2024 18:30
Youtube Subscriptions to RSS/OPML
const channels = [...document.querySelectorAll("#main-link.channel-link")].map(e => {
const [, a, b] = e.href.match("/((?:user)|(?:channel))/(.*)$");
const feed = "https://www.youtube.com/feeds/videos.xml?" + (a === "user" ? "user=" : "channel_id=") + b;
const channelName = e.querySelector("yt-formatted-string.ytd-channel-name").innerText;
return [feed, channelName];
});
if (channels.length == 0) {
alert("Couldn't find any subscriptions");
} else {
console.log(channels.map(([feed, _]) => feed).join("\n"));
@satendra02
satendra02 / app.DockerFile
Last active March 3, 2024 10:13
docker+rails+puma+nginx+postgres (Production ready)
FROM ruby:2.3.1
# Install dependencies
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
# Set an environment variable where the Rails app is installed to inside of Docker image:
ENV RAILS_ROOT /var/www/app_name
RUN mkdir -p $RAILS_ROOT
# Set working directory, where the commands will be ran:
@nsommer
nsommer / local_date_time_attr_readers.rb
Last active November 10, 2021 22:24
Concern that adds _local attr methods to convert times to a given time zone on a per user basis
# ActiveRecord stores timestamps in UTC and converts them into the application's time zone
# (see config.time_zone in config/application.rb).
#
# This module provides a simple to use API to automatically generate '_local' suffix methods
# for model attribute readers that convert dates and times according to a per model time zone.
module LocalDateTimeAttrReaders
extend ActiveSupport::Concern
included do
include ActiveModel::AttributeMethods
require 'uri'
require 'net/http'
require 'openssl'
class UrlResolver
def self.resolve(uri_str, agent = 'curl/7.43.0', max_attempts = 10, timeout = 10)
attempts = 0
cookie = nil
until attempts >= max_attempts