Skip to content

Instantly share code, notes, and snippets.

//ex1
import Foundation
func fibbo(alvo: UIntMax) -> IntMax? {
switch alvo {
case 0:
return nil
case 1...2:
return 1
default:
@PedroHLC
PedroHLC / natasha_minmax.c
Created June 29, 2016 00:13
Min Max ala CAP style
#include <stdio.h>
struct POSICAO {
double x;
double y;
};
struct POSICAO achar_min_max(int qtd_pontos, struct POSICAO *pontos) {
if(qtd_pontos == 1) {
return pontos[0];
#include <stdio.h>
#include <stdlib.h>
#define n 10
#include <time.h>
int main()
{
int vet1[n],vet2[n],uniao[n*2];
int i,j,vdd=0,max,cont=0;;
srand(time(NULL));
printf("Primeiro vetor:\n");
#include <stdio.h>
int main() {
int exemplo[] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 0}, x, y, aux;
for(y=0; y < 9; y++) {
for(x = 0; x < 9; x++)
if(exemplo[x] > exemplo[x+1]) {
aux = exemplo[x];
exemplo[x] = exemplo[x+1];
exemplo[x+1] = aux;
}
@PedroHLC
PedroHLC / tictactoe.alg
Created April 5, 2016 17:06
Visualg TicTacToe
Algoritmo "tictactoe"
// Disciplina : CAP
// Professor : Vânia
// Descrição : jogo da velha
// Autor(a) : Pedro Henrique Lara Campos
// Data atual : 05/04/2016
Var
// Seção de Declarações das variáveis
mesa: vetor [0..2,0..2] de caracter
turno: logico
pkgname=shashlik-bin
pkgver=0.9.1
pkgrel=1
pkgdesc="Android Apps on Real Linux - Precompiled binary from official repository"
arch=('x86_64')
url="http://www.shashlik.io"
license=('')
options=(!strip)
depends=('lib32-gcc-libs' 'lib32-zlib' 'python-xdg' 'kdebase-kdialog')
conflicts=('shashlik' 'shashlik-git')
@PedroHLC
PedroHLC / photoshop.pol.sh
Last active January 9, 2023 21:37
PlayOnLinux script for installing any photoshop version (x86) using winetricks
#!/bin/bash
# Create wineprefix using this script, install Photoshop, do not run it, then change wine version to '1.7.41-PhotoshopBrushes' emulating 'win7'
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
PREFIX='Photoshop'
WINEVERSION='1.9.3-staging'
TITLE='Adobe Photoshop'
EDITOR='Adobe Systems Inc.'
@PedroHLC
PedroHLC / example.uni
Last active October 10, 2017 01:14
A never finished ugly & useless programming language
global var int test
module Exemplo {
module SubModulo {
class OlhaUmaClasse {
const var<public> string test = "woohoo"
const var<public> vector<vector<int>> test2 = [[5, 6, 7, 8]]
const var<protected> double other_test = 80 + 50.5 + (60 * 8 + 7)
const var string more_test = "blabla bla ${other_test}" + ", woohoo\n"
const var<private> byte example = 0xA3
@PedroHLC
PedroHLC / interpreter_regex_inpieces.txt
Last active January 9, 2023 21:35
Regex em Pedaços
Comentarios:
\#.*\n
\/\*(?:[^\*\\]|\\.)*\*\/
Strings:
"(?:[^"\\\n]|\\.)*"
'(?:[^'\\\n]|\\.)*'
Regex:
\/(?:[^\/\\\n]|\\.)*\/[gmixXsuUAJ]*
Heredocs:
\<{3}(?'end'\w+)\n(?'heredoc'.*)\n\k'end'
@PedroHLC
PedroHLC / 0_Situation.txt
Last active January 5, 2018 00:23
VGA Passthrough Situation Diagnose
Passing GTX780 at BUS 5 (PCIEX4)
OVMF: works even from the moment bios starts - weird perfomance - fps variates a lot,
ACUnity and RE6 runs at half fps it should, system interface is
almost as smooth as native.
SeaBios: tested only Windows setup, which also works, I can see bios working too.
Passing GTX780 at BUS 1 (PCIEX16)
OVMF: error code 43
SeaBios: error code 43
Even with MSI forced, audio through HDMI is sometimes cracking, sometimes not,