Skip to content

Instantly share code, notes, and snippets.

View Ferdy89's full-sized avatar
💭
Working @ Google!

Fernando Seror Garcia Ferdy89

💭
Working @ Google!
View GitHub Profile
@Ferdy89
Ferdy89 / ubuntu-gpg-agent-ssh-support.md
Last active November 11, 2022 10:23
Enable SSH support on the GPG Agent on Ubuntu

In theory, enabling SSH support on the gpg-agent is as simple as passing the --enable-ssh-support option to the gpg-agent when initialized. However, this is tricky in Ubuntu (and probably many other Linux systems) because the gpg-agent is constantly relaunched. If we're on a machine we don't want to modify too much (as in disabling the classic ssh-agent), this is even trickier.

Here's how I solved it:

  • First, ensure the SmartCard Daemon is installed in the system (scdaemon)

  • Enable SSH support for the gpg-agent every time. While this is a system modification, it's a mild one and easy to revert.

@Ferdy89
Ferdy89 / decorator.rb
Created January 7, 2019 00:30
Decorating with metaprogramming
class Decorator
attr_reader :klass, :config, :decorator
def initialize(klass, config, decorator)
@klass = klass
@config = config
@decorator = decorator
end
def >(method_name)
@Ferdy89
Ferdy89 / Keybase.md
Last active May 23, 2018 19:28
Keybase.md

Keybase proof

I hereby claim:

  • I am ferdy89 on github.
  • I am ferdynton (https://keybase.io/ferdynton) on keybase.
  • I have a public key ASAVFDzIuo4Bvyu68j1WWeB2jZkc1RGcAUrc6G8bZerzuwo

To claim this, I am signing this object:

@Ferdy89
Ferdy89 / notes.md
Last active November 18, 2015 00:03
RubyConf 2015 Notes

Day 1

ORM Talk

  • Use Bullet
  • ActiveRecord breaks SRP

How to write good gems

  • Quick Start
  • Long README
  • Never do breaking changes if possible and use semantic versioning
  • Support as many versions as possible
@Ferdy89
Ferdy89 / calc.rb
Created May 15, 2015 19:23
Lazy verbose calculator
class VerboseCalculator < Struct.new(:stack)
NUMBERS = {
zero: 0,
one: 1,
two: 2,
three: 3,
four: 4,
five: 5,
six: 6,
seven: 7,
@Ferdy89
Ferdy89 / calc.rb
Last active August 29, 2015 14:21
Verbose calculator
class MyNum < Struct.new(:n)
NUMBERS = {
zero: 0,
one: 1,
two: 2,
three: 3,
four: 4,
five: 5,
six: 6,
seven: 7,
@Ferdy89
Ferdy89 / spuni.rb
Last active July 29, 2016 18:37
A simpler and faster alternative to FactoryGirl for testing scopes
# A simpler and faster alternative to FactoryGirl for testing scopes.
# Because the Sputnik was fast, but Spuni is even faster to pronounce.
#
# FactoryGirl is awesome on a greenfield application. It allows you to shove
# objects into the database very quickly and save a ton of code on your tests.
# The problem starts when your application grows and your god factories start
# having a lot of traits and callbacks. Then FactoryGirl's factories start
# becoming slow and hard to maintain.
#
# Not only that, your very own models might have callbacks that can make it
@Ferdy89
Ferdy89 / reload_mac.sh
Created April 26, 2014 00:14
Randomize your MAC address. Run as sudo
ifconfig wlan0 down
macchanger -r wlan0
ifconfig wlan0 up
service network-manager restart