Skip to content

Instantly share code, notes, and snippets.

View claudiug's full-sized avatar
💜
I eat stickers all the time, dude.

Klaus Heissler claudiug

💜
I eat stickers all the time, dude.
  • cto@relatico
  • Austin
View GitHub Profile
@claudiug
claudiug / missing_indices.sql
Created April 7, 2020 20:35 — forked from consti/missing_indices.sql
Find missing indices in postgres
SELECT relname, seq_scan-idx_scan AS too_much_seq, case when seq_scan-idx_scan>0 THEN 'Missing Index?' ELSE 'OK' END, pg_relation_size(relname::regclass) AS rel_size, seq_scan, idx_scan
FROM pg_stat_all_tables
WHERE schemaname='public' AND pg_relation_size(relname::regclass)>80000 ORDER BY too_much_seq DESC;
@claudiug
claudiug / app.rb
Created February 6, 2020 15:50 — forked from jgaskins/app.rb
API app with Roda
require 'authentication'
class MyApp < Roda
include Authentication
plugin :json
route do |r|
r.on('docs') { r.run Docs }
#contents of sample.rb
cat sample.rb
require './before'
puts "Hello World!"
#contents of before.rb
cat before.rb
puts "Before..."
#running:
@claudiug
claudiug / output.txt
Created September 19, 2019 19:00 — forked from headius/output.txt
JRuby's new --environment flag
[] ~/projects/jruby $ jruby.bash --environment --dev
JRuby Environment
=================
JRuby executable:
/Users/headius/projects/jruby/bin/jruby.bash
JRuby command line options:
--environment --dev
Environment:
@claudiug
claudiug / gist:41af2ad400071b9d00ded420973b07ef
Created January 24, 2017 19:50 — forked from acwright/gist:1944639
Sinatra / ActionMailer / Sendgrid / Heroku
require 'sinatra'
require 'action_mailer'
class Mailer < ActionMailer::Base
def contact
mail(
:to => "[email protected]",
:from => "[email protected]",
:subject => "Test") do |format|
format.text
require 'rubygems'
require 'httparty'
require 'benchmark'
require 'thread'
class Google
include HTTParty
base_uri 'http://google.com'
def self.benchmark
#!/usr/bin/env bash
function generate_tags {
(ctags -R -f .tags 2> /dev/null &)
}
function generate_gemtags {
(bundle show --paths | xargs ctags -R -f .gemtags 2> /dev/null &)
}