Skip to content

Instantly share code, notes, and snippets.

View Krymancer's full-sized avatar
I need some coffee

Junior Nascimento Krymancer

I need some coffee
View GitHub Profile
@Krymancer
Krymancer / Main.cpp
Last active June 25, 2019 15:47
Fast I/O methods for competitive programming
#include <bits/stdc++.h>
using namespace std;
int main(){
// THIS TWO LINES
ios_base::sync_with_stdio(false);
cin.tie(NULL);
//EXAMPLE
int n, k, t;
@Krymancer
Krymancer / cppixelbot.js
Created August 20, 2019 14:07
A simple bot to crack the pixel challeng of jerimumhs ctf campusparty2 natal 2019
var net = require('net');
// pute ntc code in here
ntc.init();
function getColorFromBase64(color){
let text = Buffer.from(color, 'base64').toString();
text = text.split('\n');
let c = text[3].split(' ');
@Krymancer
Krymancer / fibonacci.cpp
Last active March 23, 2022 03:41
All methods i know to calculate fibonacci
#include <cmath>
#include <iostream>
#include <vector>
/* This is the recursive solution to our problem. */
unsigned int fibonacci_recursive(int n) {
if (n <= 1)
return n;
return fibonacci_recursive(n - 1) + fibonacci_recursive(n - 2);
}
@Krymancer
Krymancer / Floyd'sTortoise&Hare.cpp
Created February 26, 2020 20:29
Cycle Detection
int detectLoop(Node * list) {
if (!list)
return 0;
Node * tortoise = list;
Node * hare = list;
do {
if (!(hare = hare->next) || !(hare = hare->next))
return 0;
@Krymancer
Krymancer / chrome-dark-mode.sh
Created March 3, 2020 02:29
Force dark mode in chrome
#bin/bash
if [ -z "$1" ]
then
echo "Invalid arguments"
else
sed -i 's|Exec=/usr/bin/google-chrome-stable|Exec=/usr/bin/google-chrome-stable --force-dark-mode|g' $1
fi
(defvar *jogador* 1) ;espaço do jogador
(defvar *computador* 10) ;espaço do comptador
(defun make-board ()
(list 'board 0 0 0 0 0 0 0 0 0)) ;tabuleiro
(defun convert-to-letter (v) ;funçao pra converter o input na letra
(cond ((eql v 1) "O")
((eql v 10) "X")
@Krymancer
Krymancer / cpf.js
Created April 10, 2021 07:30
Validar CPF
function verifyCPF(cpf) {
cpf = cpf.replace(/[^\d]+/g,'');
let i,add,rev;
if(cpf === '') return false;
// Elimina CPFs invalidos conhecidos
if (cpf.length !== 11 ||
cpf === "00000000000" ||
cpf === "11111111111" ||
cpf === "22222222222" ||
cpf === "33333333333" ||
@Krymancer
Krymancer / theme.json
Created August 19, 2022 16:44
Oh my phost cattpuchin-mocha theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"foreground": "#a6e3a1",
"foreground_templates": [
"{{ if gt .Code 0 }}#ff5555{{ end }}",
@Krymancer
Krymancer / main.mjs
Created December 20, 2022 19:44
signos
import { JSDOM } from "jsdom";
const url = 'https://gadget.horoscopovirtual.com.br/horoscopo';
async function getDocument() {
const response = await fetch(url);
const html = await response.text();
return html;
}
@Krymancer
Krymancer / channels.md
Last active March 5, 2023 03:59
Programming youtube related stuff