Skip to content

Instantly share code, notes, and snippets.

View fidelisrafael's full-sized avatar
🏠
Working from home

Rafael Fidelis fidelisrafael

🏠
Working from home
  • https://web.archive.org/web/20221024062310/http://www.fidelis.work/
  • Brasil
  • 04:57 (UTC -03:00)
View GitHub Profile
@fidelisrafael
fidelisrafael / feeds.py
Created December 4, 2017 18:04 — forked from ksamuel/feeds.py
RSS/Atom link auto detection. Use feedparser and beautifulsoup
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4
"""
Tools to extract feed links, test if they are valid and parse them
with feedparser, returning content or a proper error.
"""
@fidelisrafael
fidelisrafael / gist:a8cec73a7d6b1cad064d8716fc2990d2
Created January 19, 2017 19:55
Ruby AES Encryption using OpenSSL
#!/usr/bin/env ruby
require "openssl"
require 'digest/sha2'
require 'base64'
# We use the AES 256 bit cipher-block chaining symetric encryption
alg = "AES-256-CBC"
# We want a 256 bit key symetric key based on some passphrase
digest = Digest::SHA256.new
/* VT100 terminal reset (<ESC>c) */
console.log('\033c');
/* numbers comparations */
> '2' == 2
true
> '2' === 2
0815.ru
0815.ru0clickemail.com
0815.ry
0815.su
0845.ru
0clickemail.com
0-mail.com
0wnd.net
0wnd.org
10mail.com
@fidelisrafael
fidelisrafael / bookshelf.md
Created July 7, 2016 15:14 — forked from zenorocha/bookshelf.md
My bookshelf
@fidelisrafael
fidelisrafael / dropkick.sh
Created June 30, 2016 21:43
Turn off spy cams in airbnb rentals
#!/bin/bash
#
# DROPKICK.SH
#
# Detect and Disconnect the DropCam and Withings devices some people are using to
# spy on guests in their home, especially in AirBnB rentals. Based on Glasshole.sh:
#
# http://julianoliver.com/output/log_2014-05-30_20-52
#
# This script was named by Adam Harvey (http://ahprojects.com), who also
@fidelisrafael
fidelisrafael / gist:f63827e5ddac047cde6536998110aace
Created May 9, 2016 21:08 — forked from mikestone14/gist:11198630
Getting a GoDaddy domain to point to a Heroku app.
@fidelisrafael
fidelisrafael / Rakefile
Created May 5, 2016 18:43 — 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)
@fidelisrafael
fidelisrafael / ruby_csr_example.rb
Last active April 29, 2016 21:04 — forked from mitfik/ruby_csr_example.rb
Ruby example of CSR with openssl
require 'openssl'
def gen_key(name)
key = OpenSSL::PKey::RSA.new 1048
file = File.new(name, "w")
file.write(key)
file.close
end
def get_key(name)
@fidelisrafael
fidelisrafael / rspec_model_testing_template.rb
Last active September 16, 2015 19:47 — forked from SabretWoW/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems: