Skip to content

Instantly share code, notes, and snippets.

View squiter's full-sized avatar

Brunno dos Santos squiter

View GitHub Profile
Verifying my Blockstack ID is secured with the address 1GAX1DS5Fv3Y4wJUri8aKe3rzY18my473H https://explorer.blockstack.org/address/1GAX1DS5Fv3Y4wJUri8aKe3rzY18my473H
@squiter
squiter / gpg.org
Created October 19, 2017 20:28
GPG Personal Guide

GPG - Personal Guide

[2017-10-17 Tue 17:50]

I have some issues to cache my passphrase in Ubuntu. To fix it I change my default gpg binary to gpg2

Keybase proof

I hereby claim:

  • I am squiter on github.
  • I am squiter (https://keybase.io/squiter) on keybase.
  • I have a public key ASDgxPVHnRyB_vm4cU9MOyUgzytWD4tNcvMBCYaLhqgezQo

To claim this, I am signing this object:

@squiter
squiter / install_ruby
Created October 7, 2016 22:26
How to install ruby with TCL and TK for Coursera Programming Languages Part C
#!/bin/bash
set -eou pipefail
version=8.6.4.1
patchinfo=299124-linux-x86_64-threaded
dir=ActiveTcl$version.$patchinfo
package=$dir.tar.gz
url=http://downloads.activestate.com/ActiveTcl/releases/$version/$package
@squiter
squiter / postgres_queries_and_commands.sql
Created July 11, 2016 14:36 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@squiter
squiter / notifications.md
Last active March 21, 2021 13:30
Adding desktop notifications to your org-mode

This script is for OSX only! ;)

First install terminal-notifier app:

brew install terminal-notifier

After that, using this awesome scritp with some customizations in your .emacs.

@squiter
squiter / gist:cf4e474b8b51251c5085
Created April 22, 2015 01:47
Mod 11 - Módulo 11
def mod11(number, total)
as_string = number.to_s
sub = as_string.length
value = 0
max = total
sub.times do |t|
value += as_string[t].to_i * max
max = max - 1
end
@squiter
squiter / followings.rb
Created February 5, 2014 21:27
Followers in Rails
class Followings < ActiveRecord::Base
attr_accessible :user_id, :follower_id
belongs_to :user
belongs_to :follower, class_name: 'User'
belongs_to :following, class_name: 'User', foreign_key: :user_id
validates_uniqueness_of :user_id, scope: :follower_id
end
@squiter
squiter / _flash_render.html.erb
Last active June 8, 2018 05:07 — forked from potomak/_flash.html.erb
Little snippet to render flash messages using twitter bootstrap in Rails.
<% [:notice, :error, :alert].each do |level| %>
<% unless flash[level].blank? %>
<div class="alert <%= flash_class(level) %>">
<a class="close" href="#">×</a>
<%= content_tag :p, flash[level] %>
</div>
<% end %>
<% end %>
@squiter
squiter / gist:5462091
Created April 25, 2013 18:46
Your friend is a gay? Spam him with this AppleScript to send multiple messages to your gay friend using Adium! Remeber to export this script as App :P
tell application "Adium"
set eu to "your_email@here.com"
set gay to text returned of ¬
(display dialog ¬
"Quem é o Gay?" with title ¬
"Putz! Que viadão!" with icon stop ¬
default answer ¬
"" buttons {"Vai…"} ¬
default button 1)
tell account eu to set theChat to make new chat with contacts {contact gay} with new chat window