Skip to content

Instantly share code, notes, and snippets.

View MatheusRich's full-sized avatar
🤔
Always learning, always changing

Matheus Richard MatheusRich

🤔
Always learning, always changing
View GitHub Profile
@MatheusRich
MatheusRich / git-cagate.sh
Last active May 22, 2020 00:07
A simple bash script that creates a custom git command to ignore ALL kinds modifications (untracked files, modified files etc)
#!/bin/bash
# A simple bash script that creates a custom git command to ignore ALL kinds of
# modifications (untracked files, modified files, etc)
# Installation: run `sudo sh git-cagate.sh`
# Usage: run `git cagate` to ignore ALL modifications
cd /bin/ || exit
touch git-cagate
echo "touch .empty" >> git-cagate
@MatheusRich
MatheusRich / split_by.c
Last active June 21, 2019 15:25
Function to split a string by a token and add each word to an array
#include <stdio.h>
#include <string.h>
#define MAX_NUMBER_OF_FIELDS 50
#define MAX_STRING_LENGTH 50
void split_by(char *token, char *string, char array[MAX_NUMBER_OF_FIELDS][MAX_STRING_LENGTH])
{
char *raw_string = string;
char *raw_string_info = NULL;

Google Summer of Code 2019 Report

Integrate functionality from gem-web into RubyGems gem CLI

[Gem-web][gem-web] is a tool that capable of providing an interface that allows opening documentation, source code and website of a ruby gem. My goal on GSoC was integrating it on RubyGems' CLI, which would make this feature available out of the box to all ruby users, improving their productivity, since there would have no need to search this information manually.

My Planning

I spent a good time in [my proposal][proposal] planning the work of every week in the GSoC period. So, basically I had, step-by-step, what to do and when to do it. The task list was this:

@MatheusRich
MatheusRich / final-evaluation.md
Created August 23, 2019 03:43
Google Summer of Code 2019 Work Product Submission

Google Summer of Code 2019 Report

Integrate functionality from gem-web into RubyGems gem CLI

[Gem-web][gem-web] is a tool that capable of providing an interface that allows opening documentation, source code and website of a ruby gem. My goal on GSoC was integrating it on RubyGems' CLI, which would make this feature available out of the box to all ruby users, improving their productivity, since there would have no need to search this information manually.

My Planning

I spent a good time in [my proposal][proposal] planning the work of every week in the GSoC period. So, basically I had, step-by-step, what to do and when to do it. The task list was this:

@MatheusRich
MatheusRich / final-evaluation.md
Created August 23, 2019 03:43
Google Summer of Code 2019 Work Product Submission

Google Summer of Code 2019 Report

Integrate functionality from gem-web into RubyGems gem CLI

[Gem-web][gem-web] is a tool that capable of providing an interface that allows opening documentation, source code and website of a ruby gem. My goal on GSoC was integrating it on RubyGems' CLI, which would make this feature available out of the box to all ruby users, improving their productivity, since there would have no need to search this information manually.

My Planning

I spent a good time in [my proposal][proposal] planning the work of every week in the GSoC period. So, basically I had, step-by-step, what to do and when to do it. The task list was this:

@MatheusRich
MatheusRich / final-evaluation.md
Last active September 3, 2019 18:37
Google Summer of Code 2019 Work Product Submission

Google Summer of Code 2019 Report

Integrate functionality from gem-web into RubyGems gem CLI

[Gem-web][gem-web] is a tool that capable of providing an interface that allows opening documentation, source code, and website of a ruby gem. My goal on GSoC was integrating it on RubyGems' CLI, which would make this feature available out of the box to all ruby users, improving their productivity, since there would have no need to search this information manually.

My Planning

@MatheusRich
MatheusRich / rspec-order-by-modification-time.rb
Created January 23, 2020 16:36
How to sort Rspec specs by file modification time
RSpec.configure do |config|
config.register_ordering(:global) do |items|
items.sort_by { |item| -File.mtime(item.metadata[:absolute_file_path]).to_i }
end
end
@MatheusRich
MatheusRich / nested_properties.cr
Last active March 9, 2020 02:31
Macro for creating nested properties such as properties based on hash keys
macro define_option_property(*options)
{% for option in options %}
def {{option.id}}?
@options[:{{option}}]
end
{% end %}
end
class CLI
OPTIONS = {
@MatheusRich
MatheusRich / erb-vs-eruby-vs-tag.rb
Created December 31, 2020 03:47
Comparing ruby native's ERB, Eruby and Rails' tag builder
require 'bundler/inline'
gemfile do
source 'http://rubygems.org'
gem 'benchable'
gem 'rails'
gem 'erubi'
end
@MatheusRich
MatheusRich / keybase.md
Created November 26, 2021 17:56
keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object: