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
  • 01:33 (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 September 11, 2023 16:51
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 / my_app.conf
Created October 1, 2018 18:24
Nginx conf rails app (for SSL LetsEncrypt)
# Example My App
# Deploy on: /home/deploy/apps/myapp (user 'deploy' with root privilegies)
#
# 1) Setup NGINX config below and...
# 2) Install and setup LetsEncrypt:
# 2.1) $ sudo add-apt-repository ppa:certbot/certbot
# 2.2) $ sudo apt-get update
# 2.3) $ sudo apt-get install python-certbot-nginx
# 2.4) $ sudo certbot --nginx -d mysiteapp.com -d www.mysiteapp.com
# 2.5) Choose 2 and ENTER
@marlosirapuan
marlosirapuan / apns.sh
Created November 20, 2018 16:13 — forked from unnamedd/apns.sh
cURL the APNS HTTP/2 API
# Note: You MUST have curl 7.47+ with http/2 support compiled in
curl -v \
-d '{"aps":{"alert":"<message>","badge":42}}' \
-H "apns-topic: <bundle id>" \
-H "apns-priority: 10" \
--http2 \
--cert <certificate file> \
https://api.development.push.apple.com/3/device/<device token>
@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