Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Marlos marlosirapuan

🏠
Working from home
  • João Pessoa, PB - Brazil
View GitHub Profile
@marlosirapuan
marlosirapuan / gulpfile.js
Created Feb 26, 2016 — forked from plasticbrain/gulpfile.js
gulp.js task to deploy code to remote servers
View gulpfile.js
/*******************************************************************************
* Description:
*
* Gulp file to push changes to remote servers (eg: staging/production)
*
* Usage:
*
* gulp deploy --target
*
* Examples:
@marlosirapuan
marlosirapuan / twd_convert.sh
Last active Mar 2, 2016
converte arquivos *.jpg das pastas em .pdf
View twd_convert.sh
#!/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 Oct 10, 2017 — forked from SaladFork/bootstrap4_breadcrumbs_builder.rb
`breadcrumbs_on_rails` builder with Bulma compatible output
View bulma_breadcrumbs_builder.rb
# `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 |
View Installing wkhtmltopdf 0.12.4 - Ubuntu 16.04.md

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 Feb 16, 2018
Split a mp3 file ("MALEFACTOR - Sixth Legion") on macOS
View split.sh
#!/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
Simple catch all routes in Rails 5
View routes.rb
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 Oct 1, 2018
Nginx conf rails app (for SSL LetsEncrypt)
View my_app.conf
# 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 Nov 20, 2018 — forked from unnamedd/apns.sh
cURL the APNS HTTP/2 API
View apns.sh
# 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 Dec 26, 2018
AppleScript: Center Windows on Mac Mojave
View CenterWindows.scpt
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 / Podfile
Created Jan 2, 2019
Podfile: fix bug RNSVG lib (SVG, QRCode)
View Podfile
##
# package.json:
# "react": "16.6.1",
# "react-native": "0.57.4",
# "react-native-qrcode-svg": "^5.1.1",
# "react-native-svg": "^8.0.10",
# 1) rm -rf node_modules/
# 2) yarn cache clean
# 3) yarn install