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
# PhoneNumber parser | |
# Example: | |
# p = PhoneNumber.new('+380971265128') | |
# => #<PhoneNumber:0xb37b404 @value="380971265128", @locale=:uk, @pattern=[38, "097", ["126", "51", "28"]]> | |
# p.valid? | |
# => true | |
# p.to_s | |
# => "38 (097) 126-51-28" | |
# p.to_s(:prefix => true) | |
# => "+38 (097) 126-51-28" |
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
module Adriano | |
module Translate | |
extend ::ActiveSupport::Concern | |
module ClassMethods | |
attr_accessor :translated_fields | |
def translates(*args) | |
self.translated_fields = *args |
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
$ = jQuery | |
$.fn.extend({ | |
gmap: (options) -> | |
el = this.data("gmap") | |
return el if el? | |
$(this).each((input_field) -> | |
el = new Gmap(this, $(this).data()) |
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
server { | |
listen [::]:80; | |
server_name domain.tld www.domain.tld; | |
# Redirect all non-https requests | |
rewrite ^ https://$host$request_uri? permanent; | |
} | |
server { | |
listen [::]:443 ssl http2; |
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
server { | |
listen <%= @config[:ip] %>:80; | |
server_name <%= @config[:domain] %>; | |
server_tokens off; | |
location ~ /.well-known { | |
proxy_pass http://127.0.0.1:9797; | |
} | |
location / { |