Skip to content

Instantly share code, notes, and snippets.

View marlosirapuan's full-sized avatar
🏖️
Working from home

Marlos marlosirapuan

🏖️
Working from home
  • João Pessoa, PB - Brazil
  • 03:19 (UTC -03:00)
View GitHub Profile
@marlosirapuan
marlosirapuan / gulpfile.js
Created February 26, 2016 16:22 — forked from plasticbrain/gulpfile.js
gulp.js task to deploy code to remote servers
/*******************************************************************************
* Description:
*
* Gulp file to push changes to remote servers (eg: staging/production)
*
* Usage:
*
* gulp deploy --target
*
* Examples:
@marlosirapuan
marlosirapuan / twd_convert.sh
Last active March 2, 2016 00:32
converte arquivos *.jpg das pastas em .pdf
#!/bin/bash
### instala imagemagik
# brew install imagemagick
# convert *.jpg output.pdf
### dentro da pasta
# sh twd_convert.sh .
execute_convert() {
@marlosirapuan
marlosirapuan / bulma_breadcrumbs_builder.rb
Last active May 22, 2023 20:47 — forked from SaladFork/bootstrap4_breadcrumbs_builder.rb
`breadcrumbs_on_rails` builder with Bulma compatible output
# `BulmaBreadcrumbsBuilder `is a Bulma compatible breadcrumb
# builder. It is designed to work with the `breadcrumbs_on_rails` gem as a
# drop-in builder replacement.
#
# BulmaBreadcrumbsBuilder accepts a limited set of options:
#
# | option | default | description |
# | ---------------- | ------- | ------------------------------------------ |
# | `:container_tag` | `:ol` | What tag to use for the list container |
# | `:tag` | `:li` | What HTML tag to use for breadcrumb items |
@marlosirapuan
marlosirapuan / mime.types
Last active November 21, 2025 01:04
NGINX Config - Content-Security-Policy (Google, Google Fonts, Facebook, Zendesk, MaxCDN-FontAwesome, CKEditor), Cache, Mime-Types, Puma
# /etc/nginx/mime.types
types {
font/ttf ttf;
font/opentype otf;
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;

You can check here for getting the latest version. Change the wget url to download newer versions.

Install

$ wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
$ tar -xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
$ cd wkhtmltox/bin/
$ sudo mv wkhtmltopdf /usr/bin/wkhtmltopdf
@marlosirapuan
marlosirapuan / split.sh
Created February 16, 2018 20:33
Split a mp3 file ("MALEFACTOR - Sixth Legion") on macOS
#!/usr/bin/env bash
# Split a mp3 file ("MALEFACTOR - Sixth Legion") on macOS
##
# Install ffmpeg (macOS)
#
# $ brew install ffmpeg
# $ brew link ffmpeg
@marlosirapuan
marlosirapuan / routes.rb
Created May 24, 2018 21:40
Simple catch all routes in Rails 5
Rails.application.routes.draw do
# your routes bla bla
# your root controller
root to: 'home#index'
# at the end
get '*path', to: redirect('404')
end
@marlosirapuan
marlosirapuan / CenterWindows.scpt
Created December 26, 2018 16:06
AppleScript: Center Windows on Mac Mojave
set theApp to "Google Chrome"
set windowWidth to 1300
set windowHeight to 950
tell application "Finder"
set screenResolution to bounds of window of desktop
end tell
set screenWidth to item 3 of screenResolution
set screenHeight to item 4 of screenResolution
@marlosirapuan
marlosirapuan / Dockerfile
Last active September 13, 2024 06:22
Dockerfile (Ruby 2.6.2-alpine + yarn + libs + assets precompile)
FROM ruby:2.6.2-alpine
ENV APP_HOME /src/app
ARG app_env
ENV RAILS_ENV $app_env
ENV RAILS_ROOT $APP_HOME
ENV RAILS_SERVE_STATIC_FILES 1
ENV LANG C.UTF-8
ENV PATH /root/.yarn/bin:$PATH
@marlosirapuan
marlosirapuan / fix_postgresql_mojave.md
Last active April 3, 2019 20:53
Fix bug brew install postgresql on macOS Mojave (pg_tblspc, pg_commit_ts etc..)

To fix errors like..

psql: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

...

could not open directory "pg_tblspc": No such file or directory