This file contains hidden or 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
| content = '' | |
| @fields_group.each do |fg| | |
| content << @template.content_tag(:div, class: 'fields-group') do | |
| @template.concat(@template.content_tag(:div, class: 'fields-group__header') do | |
| @template.concat @template.content_tag(:h3, fg.label, class: 'fields-group__header-title') | |
| end) | |
| @template.concat(@template.content_tag(:div, class: 'fields-group__body') do | |
| fg.fields.each { |f| @template.concat @template.content_tag(:span, f.name, class: 'fields-group__field') } | |
| end) | |
| end |
This file contains hidden or 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
| def save | |
| tour = Tour.find(tour_id) | |
| discourse_user = DiscourseZr.client.user_by_external_id(user_id) | |
| discourse_user = DiscourseZr.sync_sso(User.find(user_id)) if discourse_user.nil? | |
| client = DiscourseZr.client(username: discourse_user['username']) | |
| client.create_post(topic_id: tour.discourse_topic_id, raw: content) | |
| rescue DiscourseApi::Error => e | |
| begin | |
| discourse_errors = JSON.parse(e.message.gsub('=>',':'))['errors'] | |
| discourse_errors.each { |error| errors.add(:field, error) } |
This file contains hidden or 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
| # Maintainer: Lev Lybin <lev.lybin@gmail.com> | |
| pkgname=upwork | |
| pkgver=4.0.67.0 | |
| pkgrel=1 | |
| pkgdesc="Team App (ex. oDesk)" | |
| arch=('x86_64') | |
| url="https://www.upwork.com/downloads/new-team-application" | |
| license=('unknown') | |
| depends=('gtk2' 'gcc-libs-multilib' 'nss' 'gconf' 'alsa-lib' 'glu' 'libxtst' 'gtkglext' 'libgcrypt15' 'libudev.so.0') |
This file contains hidden or 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
| class User < ActiveRecord::Base | |
| after_create :create_iugu_customer | |
| after_update :update_iugu_customer, if: 'name_changed? or email_changed?' | |
| private | |
| def create_iugu_customer | |
| iugu_customer = Iugu::Customer.create({ | |
| email: self.email, | |
| name: self.name |
This file contains hidden or 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
| POST /machines HTTP/1.1 | |
| Host: localhost:3000 | |
| User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0 | |
| Accept: */*;q=0.5, text/javascript, application/javascript, application/ecmascript, application/x-ecmascript | |
| Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3 | |
| Accept-Encoding: gzip, deflate | |
| X-CSRF-Token: ZGycdXyHsJMo0jpmmGhQRsTZheMgq0ZIJ2rSPC6Iw8N6+h7triN6zg5h9Kgh7yZXFDCuLtACYY3nBN74xK28FA== | |
| Content-Type: application/x-www-form-urlencoded; charset=UTF-8 | |
| X-Requested-With: XMLHttpRequest | |
| Referer: http://localhost:3000/calls/new |
This file contains hidden or 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
| br = TZInfo::Country.get('BR') | |
| br.zone_names => [ | |
| "America/Noronha", "America/Belem", "America/Fortaleza", "America/Recife", | |
| "America/Araguaina", "America/Maceio", "America/Bahia", "America/Sao_Paulo", | |
| "America/Campo_Grande", "America/Cuiaba", "America/Santarem", "America/Porto_Velho", | |
| "America/Boa_Vista", "America/Manaus", "America/Eirunepe", "America/Rio_Branco" | |
| ] |
This file contains hidden or 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
| ActiveSupport::TimeZone::MAPPING['Fernando de Noronha'] = 'America/Noronha' | |
| ActiveSupport::TimeZone::MAPPING['Amazônia'] = 'America/Manaus' | |
| ActiveSupport::TimeZone::MAPPING['Acre'] = 'America/Rio_Branco' | |
| ActiveSupport::TimeZone.instance_variable_set('@zones', nil) | |
| ActiveSupport::TimeZone.instance_variable_set('@zones_map', nil) | |
| module ActiveSupport | |
| class TimeZone | |
| def self.br_zones | |
| @br_zones ||= all.find_all { |z| z.name =~ /Brasilia|Noronha|Amazônia|Acre/ } |
This file contains hidden or 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
| function named_home | |
| sudo sed -e 's/ \/\/forwarders { 8.8.8.8; 8.8.4.4; };/ forwarders { 8.8.8.8; 8.8.4.4; };/' /etc/named.conf | sed -e 's/ forwarders { corporate_dns_1; corporate_dns_2; };/ \/\/forwarders { corporate_dns_1; corporate_dns_2; };/' > /tmp/named.conf.tmp; sudo mv /tmp/named.conf.tmp /etc/named.conf | |
| sudo systemctl stop named | |
| sudo systemctl start named | |
| end | |
| function named_unioeste | |
| sudo sed -e 's/ forwarders { 8.8.8.8; 8.8.4.4; };/ \/\/forwarders { 8.8.8.8; 8.8.4.4; };/' /etc/named.conf | sudo sed -e 's/ \/\/forwarders { corporate_dns_1; corporate_dns_2; };/ forwarders { corporate_dns_1; corporate_dns_2; };/' > /tmp/named.conf.tmp; sudo mv /tmp/named.conf.tmp /etc/named.conf | |
| sudo systemctl stop named | |
| sudo systemctl start named |
This file contains hidden or 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/sh | |
| case "$2" in | |
| up|vpn-up) | |
| IP=`/sbin/ifconfig | grep 'inet '| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $2}'` | |
| case $IP in | |
| 10.*) | |
| logger "configNetwork.sh - setting configurations for enterprise net" | |
| forwarders=" forwarders { corporate_dns_1; corporate_dns_2; };" | |
| NoProxy="NoProxy localhost, 127.0.0.*, 10.*, 192.168.*, *.mydomain.dev.br, *.myenterprise.br" | |
| ;; |
This file contains hidden or 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
| function init --on-event init_direnv | |
| if available direnv | |
| function __direnv_export_eval --on-variable PWD | |
| status --is-command-substitution; and return | |
| eval (direnv export fish) | |
| end | |
| else | |
| echo "📂 Please install 'direnv'!" | |
| end | |
| end |