Skip to content

Instantly share code, notes, and snippets.

View rplaurindo's full-sized avatar
🎯
Focusing

Rafael rplaurindo

🎯
Focusing
  • Rio de Janeiro - RJ, Brasil
View GitHub Profile
@rplaurindo
rplaurindo / git.md
Last active January 10, 2021 04:24

Configurations

git config

Proxy

Use global configuration with --global flag.

$ git config --global https.sslBackend openssl
-- SQLite
DELETE FROM [table]
DELETE FROM sqlite_sequence

Installing

For the Java works, you should install the JDK (Java Development Kit) and the JRE (Java Runtime Environment).

The JDK is the VM (Virtual Machine) of the Java. It’s responsible for compile the source code that will be executed.

The JRE is responsible for the environment, how to define variables and read them.

  • JDK
@rplaurindo
rplaurindo / Rails task.md
Last active February 25, 2018 23:29
$ rake namespace:task['Hello,Wolrd!']
# lib/tasks/task_example.rake
namespace :namespace_1 do
  # without this line the task will not be enumerated in rake -T
  desc "Description"

  task :task_name, [:params] => [:environment] do |t, arbitrary|
    # it works as splat operator
    params = arbitrary.extras.unshift arbitrary[:params] ? arbitrary[:params] : "no params"

p params

# Estarta o servidor python na aplicação
$ python -m SimpleHTTPServer <port>
# Guia de Instalação: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki/Using-TinyTDS
# requirements
# freetds-dev
$ sudo apt-get install -fyu freetds-dev
# Intale as gems "tiny_tds" e "activerecord-sqlserver-adapter"
# Obs.: O método "set_table_name" poderá ser usado para definir um outro nome para as tabelas no modelo
# list generators
$ rails generate

# É importante fazermos algumas considerações para os casos de se trabalhar com namespace:
# O nome do arquivo com _generator.rb deve ter o mesmo nome da classe;
  # sample_generator.rb => class SampleGenerator
  # A classe deve ficar numa pasta com o nome do primeiro módulo;

# lib/generators/error_page/install_generator.rb

module ErrorPage

@rplaurindo
rplaurindo / 1 - shell commands.md
Last active January 10, 2023 00:25
Linux utils

Shell Commands

System informations

$ lsb_release -a

Discovering the UUID of a device

Run

Working with gems

Generating a new gem structure

$ bundle gem <gem_name>

Adding an owner

$ gem owner <gem> -a <user or email>

Generating

Run:

$ rails plugin new <name>

To generate a isolated engine use --mountable

The .rb file generated in folder lib should have the same name of the gem, otherwise it will not load automatically.