Skip to content

Instantly share code, notes, and snippets.

View douglasresende's full-sized avatar
💡
I'll do my best

Douglas douglasresende

💡
I'll do my best
  • San Francisco, CA
View GitHub Profile
// ==UserScript==
// @name Unblur scribd.com
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://vi.scribd.com/*
// @grant none
// ==/UserScript==
(function() {
@douglasresende
douglasresende / readme.md
Created November 10, 2021 16:56 — forked from devdrops/readme.md
tmuxinator sample

tmuxinator

  • Config sample (en_US)
  • Exemplo de configuração (pt_BR)
@douglasresende
douglasresende / backup.sh
Created August 26, 2021 19:00 — forked from cedricvidal/backup.sh
ElasticSearch log index backup & restore scripts
#!/bin/bash
# herein we backup our indexes! this script should run at like 3 AM every first day of the month, after logstash
# rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas,
# compress the data files and backs up to whatever long term storage.
. ./config.sh
echo "Checking that index exist in ES"
if [ `curl -sI $ESURL/$INDEXNAME | grep OK | wc -l` -eq 0 ]
then
@douglasresende
douglasresende / security.conf
Created January 29, 2021 17:08 — forked from ambroisemaupate/security.conf
Nginx CSP example
# config to don't allow the browser to render the page inside an frame or iframe
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri
# https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
add_header X-Frame-Options SAMEORIGIN;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,
# to disable content-type sniffing on some browsers.
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers
# currently suppoorted in IE > 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx
@douglasresende
douglasresende / slugify.exs
Created January 17, 2019 14:52 — forked from serradura/slugify.exs
Elixir slugify functions
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()
@douglasresende
douglasresende / fp_01.rb
Created January 17, 2019 14:51 — forked from serradura/fp_01.rb
Examples of how Ruby 2.6 is more functional than ever! 👏🎉🚀
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 / webpacker_rails.md
Created August 16, 2018 19:50 — forked from maxivak/webpacker_rails.md
Webpack, Yarn, Npm in Rails
@douglasresende
douglasresende / readme.md
Created August 16, 2018 19:47 — forked from maxivak/readme.md
Integrating Gem/Engine and Main Rails App
@douglasresende
douglasresende / IMfromsource.md
Created April 20, 2018 17:29 — forked from makenova/IMfromsource.md
Install ImageMagick from source on Ubuntu 14.04

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

DigitalOcean S5

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

CPU info