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
  • 08:07 (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() {

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 / 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
@marlosirapuan
marlosirapuan / InputMask.md
Last active May 1, 2019 22:40
Ant Design with InputMask

Based on this comment

Fix warning when use react-hooks:
Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

// shared/InputMask.js

import { Input } from 'antd'
import React, { forwardRef } from 'react'
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'activerecord', '5.1.3'
@marlosirapuan
marlosirapuan / test_helper.rb
Created July 25, 2019 20:02
Minitest hooks
class ActiveSupport::TestCase
def self.prepare
# Add code that needs to be executed before test suite start
end
prepare
def setup
# Add code that need to be executed before each test
end