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
| name: Deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| name: Build & Deploy app | |
| runs-on: ubuntu-latest |
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
| import sys | |
| import subprocess | |
| def run_pip(*args): | |
| pip_cli = [sys.executable, '-m', 'pip', *args] | |
| with subprocess.Popen(pip_cli, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as process: | |
| out, err = process.communicate() | |
| return process.returncode, out.decode('utf8').strip(), err.decode('utf8').strip() | |
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
| #!/usr/bin/ruby | |
| lines1 = File.readlines(ARGV[0]).uniq | |
| lines2 = File.readlines(ARGV[1]).uniq | |
| diff = lines1.difference(lines2) | |
| if ARGV.length >= 3 | |
| open(ARGV[2], 'w') { |file| diff.each { |d| file << d } } | |
| else | |
| puts diff | |
| 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 next_char(file) | |
| begin | |
| file.readchar | |
| rescue EOFError | |
| nil | |
| end | |
| end | |
| if ARGV.empty? | |
| puts "No SQL file was given" |
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
| require 'nokogiri' | |
| require 'net/http' | |
| require 'open-uri' | |
| require 'json' | |
| require 'cgi' | |
| def escape url | |
| # since uri.encode/escape was removed and | |
| # CGI.escape escapes chars that should not | |
| temp = url.split '/' |
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
| #! /usr/bin/python3 | |
| from pathlib import Path | |
| import sys, os | |
| def print_dir(dir : Path, level : 0): | |
| for sub in dir.iterdir(): | |
| if sub.is_dir(): | |
| print(' ' * level, sub.name) | |
| print_dir(sub, level + 1) |
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
| document.addEventListener("dragstart", (event) => { | |
| event.dataTransfer.setData("Text", event.target.id) | |
| event.target.style.opacity = "0.4 | |
| }) | |
| document.addEventListener("dragend", (event) => { | |
| event.target.style.opacity = "1" | |
| }) |
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
| # -- coding: utf-8 -- | |
| v1 = float(input()) | |
| v2 = float(input()) | |
| r = (v1 * 3.5 + v2 * 7.5) / 11 | |
| print("MEDIA = " + "{:.5f}".format(r)) |
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
| use cdmanhafatec2; | |
| DROP PROCEDURE IF EXISTS proc_main; | |
| DROP PROCEDURE IF EXISTS proc_parity; | |
| DROP PROCEDURE IF EXISTS proc_factorial; | |
| DROP PROCEDURE IF EXISTS proc_is_prime; | |
| DROP PROCEDURE IF EXISTS proc_insert_in_mult_table_of; | |
| delimiter end_proc |
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
| import csv | |
| from random import randrange as rand | |
| # --- gerador estado usando o cvs de https://github.com/kelvins/Municipios-Brasileiros (salvado como cidade.csv) | |
| # --- que tem o as seguintes colunas: codigo_ibge,nome,latitude,longitude,capital,codigo_uf | |
| c = csv.reader(open('cidade.csv'), delimiter=',') | |
| for l in c: | |
| print("({}, '{}', '{}'),".format(l[0], l[2], l[1])) |
NewerOlder