- Config sample (en_US)
- Exemplo de configuração (pt_BR)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = |
All code is available in example app - https://github.com/maxivak/webpacker-rails-example-app
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
NewerOlder