Skip to content

Instantly share code, notes, and snippets.

View gentildpinto's full-sized avatar

Gentil Pinto gentildpinto

View GitHub Profile
@gentildpinto
gentildpinto / truncatePgSQL.sql
Created January 4, 2025 12:49
Truncate PostgreSQL Database
DO $$
DECLARE
r RECORD;
BEGIN
-- Disable all triggers temporarily
SET session_replication_role = 'replica';
FOR r IN (SELECT tablename FROM pg_tables WHERE schemaname = 'public')
LOOP
EXECUTE 'TRUNCATE TABLE ' || quote_ident(r.tablename) || ' CASCADE';
@gentildpinto
gentildpinto / webrick-ssl.rb
Created January 6, 2025 13:44
Configure Webrick Server as SSL
#!/usr/bin/env ruby
require 'rubygems'
require 'rails/commands/server'
require 'rack'
require 'webrick'
require 'webrick/https'
module Rails
class Server < ::Rack::Server
def default_options
@gentildpinto
gentildpinto / LearnGoIn5mins.md
Created February 12, 2025 06:52 — forked from prologic/LearnGoIn5mins.md
Learn Go in ~5mins