Skip to content

Instantly share code, notes, and snippets.

View matheussilvasantos's full-sized avatar
🐧

MΛTHЄUS SILVΛ matheussilvasantos

🐧
View GitHub Profile
ints = ["[3604 Available]", "[3608 Available]", "[3612 Available]", "[3615 Invoiced]"]
ints.grep(/Available/).map{|int|int[/\d+/].to_s}
"h3ll0".scan(/\d/)
var gulp = require("gulp");
var sass = require("gulp-sass");
var useref = require("gulp-useref");
var uglify = require("gulp-uglify");
var gulpIf = require("gulp-if");
var cssnano = require("gulp-cssnano");
var imagemin = require("gulp-imagemin");
var cache = require("gulp-cache");
var del = require("del");
var browserSync = require("browser-sync").create();
@matheussilvasantos
matheussilvasantos / search_form.rb
Last active January 18, 2019 13:08
Hanami validations using an optional array with Hashs in it.
require 'hanami/validations/form'
class SearchForm
include Hanami::Validations::Form
validations do
optional(:filter).maybe do
schema do
optional(:category).each do
schema do
@matheussilvasantos
matheussilvasantos / handler.rb
Created May 2, 2019 16:56
Campo harmônico
require 'json'
@acordes ||= Hash.new {|h,k| h[k] = [] }
def lambda_handler(event:, context:)
@acordes ||= Hash.new {|h,k| h[k] = [] }
params = JSON.parse(event["body"])
puts "[LOGGER] #{params}"
session = params["session"]
acorde = params["queryResult"]["parameters"]["acorde"]
@matheussilvasantos
matheussilvasantos / Dockerfile
Created May 8, 2019 09:38
Dockerfile for CodeBuild
FROM ruby:2.6.3
RUN curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - &&
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - &&
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list &&
sudo apt-get update &&
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev \
libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common \
libffi-dev nodejs yarn
module REST
def self.OAuth(client)
REST::OAuth.new(client)
end
class OAuth < Module
def initialize(client)
@client = client
freeze
end
find . -iname "*.mp3" -maxdepth 1 | ag -o "audio.*.mp3" | xargs -I{} ffmpeg -ss 00:00:08 -i {} -c copy cut/{}
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'Xuyuanp/nerdtree-git-plugin'
Plugin 'jistr/vim-nerdtree-tabs'