Skip to content

Instantly share code, notes, and snippets.

View arthurstomp's full-sized avatar

Arthur Rocha de Menezes arthurstomp

View GitHub Profile
@arthurstomp
arthurstomp / log-notify.sh
Created July 18, 2021 20:35
Get dbus messages from 'notify-send'
dbus-monitor "interface='org.freedesktop.Notifications'" |\
grep --line-buffered "string" |\
grep --line-buffered -e method -e ":" -e '""' -e urgency -e notify -v |\
grep --line-buffered '.*(?=string)|(?<=string).*' -oPi |\
grep --line-buffered -v '^\s*$'
@arthurstomp
arthurstomp / init.vim
Created March 20, 2019 21:51
init.vim
set nocompatible
filetype off
set encoding=UTF-8
set nobackup
set nowritebackup
set noswapfile
call plug#begin('~/.local/share/nvim/plugged')
" Aesthetics
" Plugins
call plug#begin('~/.local/share/nvim/plugged')
" Aesthetics - Main
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'ryanoasis/vim-devicons'
Plug 'junegunn/goyo.vim'
Plug 'junegunn/limelight.vim'
Plug 'junegunn/vim-journal'
Plug 'junegunn/rainbow_parentheses.vim'
@arthurstomp
arthurstomp / romans.rb
Created August 8, 2018 14:55
Int to Romans
class Romans
@@romans = {
1000 => 'M',
900 => 'CM',
500 => 'D',
400 => 'CD',
100 => 'C',
90 => 'XC',
50 => 'L',
40 => 'XL',
@arthurstomp
arthurstomp / Rakefile
Last active August 6, 2018 01:11 — forked from schickling/Rakefile
Activerecord without Rails
require "active_record"
namespace :db do
db_config = YAML::load(File.open('config/database.yml'))
db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'})
desc "Create the database"
task :create do
ActiveRecord::Base.establish_connection(db_config_admin)
@arthurstomp
arthurstomp / intefaces
Created August 3, 2018 01:06
Connect linux to wifi
# at /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
auto wlan0
var express = require('express')
var app = express();
var expressWs = require('express-ws')(app);
var si = require('systeminformation');
const port = 4000
var totalSubs = 0
app.ws('/sub', (ws, req) => {
totalSubs += 1;
console.log('Total subscriptions : '+totalSubs);
@arthurstomp
arthurstomp / keybase.md
Created December 13, 2016 21:21
keybase.md

Keybase proof

I hereby claim:

  • I am arthurstomp on github.
  • I am arthurstomp (https://keybase.io/arthurstomp) on keybase.
  • I have a public key whose fingerprint is A9FB 4A20 53E4 606F B808 F493 DAA0 F543 E416 771C

To claim this, I am signing this object:

@arthurstomp
arthurstomp / README.md
Last active December 2, 2016 23:09
Ruby Decorator Design Pattern

Ruby Decorator Design Pattern

While styding the Decorator Design Pattern i read there was a drawback on implementing the Decorator pattern using the module + extend + super implementation.

The drawbacks of this implementation are

  1. can not use the same decorator more than once on the same object

  2. difficult to tell which decorator added the functionality