Skip to content

Instantly share code, notes, and snippets.

View pedrogrande's full-sized avatar

Pete Argent pedrogrande

View GitHub Profile
@lopezjurip
lopezjurip / README.md
Last active July 19, 2017 09:01
Ruby on Rails - Send (batch) emails using mailgun-ruby (HTTP, not SMTP)

Requisites:

  • Create a free account at https://www.mailgun.com/
  • Save your API Key as a environment variables: export MAILGUN_API_KEY=key-1111111111111111111111111

As example, I will use a model named Request.

@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active June 2, 2024 11:23
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@thatandyrose
thatandyrose / string.rb
Created June 6, 2013 10:46
Add some grammar helpers to your String!
class String
def articleize
me = self.downcase
an_startswith = ['a','e','i','o','u']
an_exceptions = ['unit'] #add more when you think of them!
if me.start_with?(*(an_startswith + an_exceptions))
return "an #{self}"
else
return "a #{self}"