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
| #Q2129288 | |
| def ABC(L, n): | |
| while True: | |
| if len(L) >= n: | |
| return L | |
| else: | |
| print("--(len(L))--") | |
| print("-----------------") |
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
| #Exemplo de url: http://www.teste.com/account/search?filter=a#top | |
| window.location.pathname # /account/search | |
| window.location.host # www.somedomain.com (Se houver uma porta será exibida ao final) | |
| window.location.hostname # www.somedomain.com | |
| window.location.hash # #top | |
| window.location.href # http://www.teste.com/account/search?filter=a#top | |
| window.location.port # (Se houver uma porta será exibida) | |
| window.location.protocol # http: | |
| window.location.search # ?filter=a |
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
| 1. Inicialize a partir de um Live CD ou USB contendo um sistema Linux. | |
| 2. Abra um terminal e monte a partição raiz do Linux (/dev/nvme0n1p1 no meu caso): | |
| sudo mkdir /mnt/temp | |
| sudo mount /dev/nvme0n1p1 /mnt/temp | |
| 3. Chroot no ambiente Linux: | |
| sudo mount --bind /dev /mnt/temp/dev | |
| sudo mount --bind /proc /mnt/temp/proc | |
| sudo mount --bind /sys /mnt/temp/sys |
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
| # Include | |
| module Commentable1 | |
| def comment | |
| '*** Commentable1 ' | |
| end | |
| end | |
| module Commentable2 | |
| def comment | |
| '*** Commentable2 ' |
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
| # Iniciar | |
| sudo cd tomcat/bin; ./startup.sh | |
| # Parar | |
| sudo cd tomcat/bin; ./shutdown.sh | |
| # Alterar Porta | |
| # Na pasta do tomcat, dentro de conf, há o arquivo server.xml. Dentro do arquivo, procure o nó Connector e altere a porta: |
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
| ### HTML ##################### | |
| ############################## | |
| <%= a.attribute_select({:include_blank => 'Escolha um campo de busca'},:class => 'form-control', id: "campo_atual") %> | |
| <%= c.predicate_select({:only => [:i_cont,:not_i_cont, :eq], :compounds => false}, :class => 'form-control', id: "condicao_atual") %> | |
| <%= v.text_field :value, class:'form-control', placeholder:'Insira um valor a ser pesquisado', id: "filtro_atual" %> | |
| <%= link_to "Salva", '#', class: "salva_fields" %> | |
| ### Javascript, Jquery ######## | |
| ############################### |
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
| # COMANDOS | |
| rails new appname -d postgresql | |
| rails new appname --api | |
| gem install rails -v 6.1.4.4 | |
| rails _6.1.4.4_ new myapp | |
| # Rails sem webpack | |
| rails new app-name --skip-webpack-install --skip-javascript |
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
| # Models from existing tables | |
| class YourIdealModelName < ActiveRecord::Base | |
| self.table_name = 'actual_table_name' | |
| self.primary_key = 'ID' | |
| self.sequence_name = 'name_seq' | |
| belongs_to :other_ideal_model, | |
| :foreign_key => 'foreign_key_on_other_table' | |
| has_many :some_other_ideal_models, |
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
| # Version 21.5.0.0.0 (Requires glibc 2.14) | |
| # Instalar a biblioteca | |
| sudo apt-get install libaio1 unzip | |
| # Criar a pasta | |
| sudo mkdir /opt/oracle | |
| # Mover para /opt/oracle | |
| instantclient-basic-linux.x64-21.5.0.0.0.zip | |
| instantclient-sdk-linux.x64-21.5.0.0.0.zip |
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
| # frozen_string_literal: true | |
| #!/usr/bin/ruby | |
| require 'securerandom' | |
| numero_sorteado = "781040" | |
| rodadas = 0 | |
| acerto_1 = false |
NewerOlder