Skip to content

Instantly share code, notes, and snippets.

View geonnave's full-sized avatar

Geovane Fedrecheski geonnave

View GitHub Profile
import servidor_caseiro, json
produtos = [
"Banana",
"Maçã",
"Laranja",
]
def ler_carrinho(method, path, request_body):
return "<h1>Carrinho de compras</h1>", "200 OK"
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
@geonnave
geonnave / inventario2.sol
Created July 27, 2022 01:20
aula polichain smart contracts com o Rob
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.6;
// cofre, que o dono define quem é a pessoa que pode sacar, e em qual data
contract Inventario {
uint256 public dataSaque;
address payable public herdeiro;
address public dono;
@geonnave
geonnave / fastnav.sh
Last active February 17, 2020 17:31
A faster way to go up and down unix directories
#!/bin/bash
# MIT License
# Copyright (c) 2020 Geovane Fedrecheski
# https://choosealicense.com/licenses/mit/
# function fastnav_up -> navigate up N directories
# param $1
# must be a number, indicate how many directories to navigate up
# if omitted, navigate up only one directory
defmodule Test do
def in_range?(<<min, "-", max>>, <<value>>) do
min <= value && value <= max
end
def in_range?(_range, _value), do: false
end
Test.in_range?("1-5", "3") # true
" add this to your .vimrc and have some highlights when viewing log files
" originally made for Android logs; just change the regex for other kinds of logs
" the negative number (which is the priority arg) prevents these rules to
" override the Search Highlight, since it has priority equal to 0
" not extensively tested; may need additional .vimrc settings
" (worked with this settings: https://github.com/geonnave/dotfiles/blob/master/.vimrc)
" color codes taken from http://vim.wikia.com/wiki/Xterm256_color_names_for_console_Vim
" error lines have red text
highlight log_error ctermfg=203
@geonnave
geonnave / phylte_solver.rb
Last active August 29, 2015 14:19
Calculating LTE Physical Stuff (Downlink)
class PhylteSolver
def initialize(params)
@bpsy = params[:bpsy]
@bandwidth = params[:bandwidth]
@guard_band = params[:guard_band]
@deltaf = 15000
@n_reference_symbols = 4
@ofdm_symbols = {:normal => 7, :extended => 6}
end
@geonnave
geonnave / pica_pau_counter
Created January 11, 2015 21:20
pica pau counter
n = 17 #number of food items
i = 1 #food items pica-pau will get
j = 0 #food items zeca urubu will get
k = 0 #pica-pau food items plus zeca urubu food items
while k < n #k cannot be greater than n
print i.to_s + " pra voce;\n"
j = 1
while j <= i and k < n
print j.to_s + ", "
j += 1
@geonnave
geonnave / navigate_up.sh
Last active August 29, 2015 14:13
Easier way to navigate up directories using bash
# function navigate_up -> navigate up N directories
# param $1 -> must be a number, indicate how many directories to navigate up;
# if omitted, navigate up only one directory
# other parameters -> ignored
navigate_up() {
# if there aren't parameters, navigate up only 1 directory and stop
[ -z "$1" ] && cd .. && return 0
# filter parameter $1, should contains only numbers
non_number_chars=$( echo $1 | sed "s/[0-9]*//g" )