Skip to content

Instantly share code, notes, and snippets.

require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rvm'
set :user, 'root'
set :domain, '111.111.111.111'
set :deploy_to, '/home/rails/project-rails'
set :repository, 'repository-git'
set :shared_paths, ['config/database.yml', 'log', 'tmp', 'public/system']
@mr4torr
mr4torr / theme-one-dark-monokai.json
Last active October 2, 2017 04:27
Theme Dark VS Code
{
"name": "Themer Dark",
"type": "dark",
"colors": {
"focusBorder": "#F92672",
"foreground": "#ABB2BF",
"widget.shadow": "#282C3466",
"selection.background": "#282C34",
"errorForeground": "#AE81FF",
"button.background": "#AE81FF",
@mr4torr
mr4torr / letsencrypt_2017.md
Created January 30, 2018 12:03 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

# Entrar no servidor e fora da pasta do projeto
$ cd /home/webmaster/
$ mkdir repository && cd repository
$ mkdir site.git && cd site.git
$ git init --bare
$ cd hooks
$ vim post-receive
@mr4torr
mr4torr / netvirtua_netcombo-config-ssh.md
Last active December 8, 2022 18:38
NET não libera a porta 22 e impede de acessar por ssh github/bitbucket

Usar ssh do github e do bitbucket com wifi do netcombo /netvirtua

A NET só libera o uso de qualquer porta, como a porta 22 de ssh, para pessoa jurídica em seus novos planos (desde 2016).

Para conseguir usar o github ou bitbucket por ssh com plano de internet da NET para pessoa física, é necessário:

Criar o arquivo ~/.ssh/config e adicionar:

Host github.com
@mr4torr
mr4torr / test multiple caracteres
Last active March 7, 2019 17:23
Teste para inserção em um textarea com múltiplos caracteres especias
câmera é @ssim 3ªº° geração? "vou ver e te aviso à manhã" 5% de hülse's #sextou
R$50 reais toma aqui! 02/12/1989 |matriz| brave\new\world potencia¹²³ ¢25 to de mal ¬¬
Testando – !@#$%¨&*()_+=-0¹²³£¢¬§ é É Á Ó Í Ú é ú ó t ž š ä ö ü ß é ë æ ø € $ ¶ @ : ; /
€ ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž ‘ ’ “ ” • – — ™ š › œ ž Ÿ ] ' " € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž ‘ ’
“ ” • – — ™ š › œ ž Ÿ
" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
Plug 'ryanoasis/vim-devicons'
" Make sure you use single quotes
" Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
@mr4torr
mr4torr / attachment_concern.rb
Last active March 18, 2019 22:28
Simple Form: input with preview image / Concern per paperclip = seo friendly and easy remove file
#
# save file: app/models/concerns/attachment_concern.rb
#
# Example:
# -------------------------------------
# add Model ------------
# has_attached_file :picture, styles: {
# medium: "600x315#",
# thumb: "160x160>"
# }
<?php
/*
* Google Font Importer
*/
$fonts = "https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyCpfnm5kVng8hhP_jnAnnTXVP7MEUM89-k";
$fonts = file_get_contents($fonts, 0, null, null);
$fp = fopen('fonts.txt', 'w');
@mr4torr
mr4torr / highlight.js
Last active July 12, 2019 02:23
Javascript pure searches for words in a string, works with special characters
const highlight_open = '<span>';
const highlight_close = '</span>';
const text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed odio purus. Ut hendrerit quam id auctor aliquet. Nam et leifend purus, vel elementum nunc. Cras ac facilisis sem. Integer ullamcorper honcus iaculis. Praesent posuere dui tellus, sed interdum libero varius n. Nulla tristique pulvinar sem bibendum fermentum. In purus mi, viverra itae interdum ac, semper eu felis. Vivamus nisi ligula, consequat ut orci non, endrerit iaculis magna. Mauris a sapien fringilla, egestas dolor id, porta sapien. Praesent id magna et leo rutrum feugiat ac nec est. Vestibulum psum metus, interdum eget porttitor ut, feugiat ut diam. Mauris sed ultrices orci. Nam mollis in purus vitae elementum. Aliquam erat volutpat. Nulla pharetra gravida placerat. Nunc leo mauris, auctor a elit vitae, lacinia sollicitudin diam. Nunc porttitor varius tellus. Sed eu ullamcorper elit. Nam rutrum arcu id sodales vestibulum. Quisque fringilla, turpis in porta