Skip to content

Instantly share code, notes, and snippets.

Avatar
💡
I'll do my best

Douglas douglasresende

💡
I'll do my best
  • San Francisco, CA
View GitHub Profile
@MichaelBarney
MichaelBarney / MonsterLojaFufillment.js
Last active Apr 2, 2022
Exemplo de um 'fufillment' para ser usado no Dialogflow
View MonsterLojaFufillment.js
'use strict';
const functions = require('firebase-functions');
const {WebhookClient} = require('dialogflow-fulfillment');
var nodemailer = require('nodemailer');
function enviarEmail(usuario, produto, quantidade){
// Configurações do Email
var transporter = nodemailer.createTransport({
service: 'gmail',
@devdrops
devdrops / readme.md
Last active Nov 10, 2021
tmuxinator sample
View readme.md

tmuxinator

  • Config sample (en_US)
  • Exemplo de configuração (pt_BR)
@serradura
serradura / slugify.exs
Last active Jan 17, 2019
Elixir slugify functions
View slugify.exs
defmodule Slug1 do
def slugify(input), do: map_slug(input, %{pattern: ~r/\s+/})
def slugify2(input), do: map_slug(input, %{pattern: " "})
defp map_slug(input, %{pattern: pattern}) do
input
|> to_string()
|> String.trim()
|> String.downcase()
@serradura
serradura / fp_01.rb
Last active Jan 17, 2019
Examples of how Ruby 2.6 is more functional than ever! 👏🎉🚀
View fp_01.rb
raise 'Wrong Ruby version!' unless RUBY_VERSION >= '2.6.0'
module Strings
Trim = -> str { String(str).strip }
Replace = -> (sub, new_sub, str) { String(str).gsub(sub, new_sub) }
LowerCase = -> str { String(str).downcase }
end
# -- Alternative syntax --
Slugify = # Slugify =
@douglasresende
douglasresende / IMfromsource.md
Created Apr 20, 2018 — forked from makenova/IMfromsource.md
Install ImageMagick from source on Ubuntu 14.04
View IMfromsource.md

Install ImageMagick from source on Ubuntu 14.04

The version of ImageMagick that is installed when you run apt-get install imagemagick on Ubuntu 14.04 is older than I would like.

$ convert --version
Version: ImageMagick 6.7.7-10 2016-06-01 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
View DigitalOcean_S5.md

DigitalOcean S5

  • 5$
  • 1 CPU
  • 512Mb memory
  • 1T transfer
  • 20GB SSD

CPU info

@makenova
makenova / IMfromsource.md
Last active Nov 3, 2020
Install ImageMagick from source on Ubuntu 14.04
View IMfromsource.md

Install ImageMagick from source on Ubuntu 14.04

Note

These notes were for a job I am no longer at and are very dated. Please go to the imagemagick website for updated instructions.

The version of ImageMagick that is installed when you run apt-get install imagemagick on Ubuntu 14.04 is older than I would like.

$ convert --version
@balupton
balupton / README.md
Last active Feb 23, 2022
Convert XPS to PDF
View README.md

Convert XPS to PDF on macOS

# IF you are on alpine, install the dependencies
apk add curl git bash

# IF you are on ubuntu, install the dependencies
apt update
apt install curl git bash
@chbrown
chbrown / _upgrade-pg9.4-to-pg9.5.md
Last active Oct 7, 2021
Upgrade PostgreSQL 9.4 to 9.5 on Mac OS X with Homebrew
View _upgrade-pg9.4-to-pg9.5.md

First, check your current config (example output in homebrew.mxcl.postgresql.plist.xml lower down in this gist):

cat ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

Most importantly, note the -D /usr/local/var/postgres argument.

Second, shut down your current PostgreSQL.

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist