Skip to content

Instantly share code, notes, and snippets.

View KlausEverWalkingDev's full-sized avatar
🇧🇷

Klaus Ferreira KlausEverWalkingDev

🇧🇷
View GitHub Profile
@CalisaP
CalisaP / truthy_falsy.js
Last active June 30, 2019 17:59
fCC: Intermediate Algorithm Scripting: Everything Be True
//Check if the predicate (second argument) is truthy on all elements of a collection (first argument).
function truthCheck(collection, pre) {
// .every returns one value if EVERY object statifies the test.
// !! (double bang) typecasts the property value to a boolean value.
// It will return true if the property value is truthy & false if the property doesn't exist/has a falsy value.
return collection.every(obj => !!obj[pre]);
}
truthCheck([{"user": "Tinky-Winky", "sex": "male"}, {"user": "Dipsy", "sex": "male"}, {"user": "Laa-Laa", "sex": "female"}, {"user": "Po", "sex": "female"}], "sex");
@VycktorStark
VycktorStark / main.py
Last active June 15, 2020 10:26
Simple bot with webhook - TELEGRAM BOT
__author__ = "Vycktor Stark"
"""
This is a simple project to run your bot on Telegram and receive requests for new events via webhook on your server
To be very practical, I am using the / lib flask module to create this project!
Where you just need to declare your bot's token and the code itself will import other things, like your host, Instructions:
- Declare your bot's token here;
- Run the script on your server;
- Access your host + webhookstart (example: https://mysite.com/webhookstart)
@VycktorStark
VycktorStark / main.py
Last active August 13, 2020 15:28
Simple bot with polling - TELEGRAM BOT
__author__ = "Vycktor Stark"
"""
This is a simple project to run a bot on the telegram via polling (webscraping) without using a module or lib
to start the code, after the download, just first insert your bot key to it and run as follows: `python3 main.py`
Note: I am aware that it is much more practical to use the / lib module to create the code faster,
but the goal of this snippet is to demonstrate an alternative for you to create the code your way
"""
from threading import Thread
import json, requests, re, time
@jq2
jq2 / gist:1c3771d581015648c807d2abebc989e6
Last active January 4, 2021 03:53
Lista de canais com cursos e/ou vídeo aulas sobre computação (Português pt_BR).
Code Shadow
https://www.youtube.com/c/CodeShadow
DevDojo
https://www.youtube.com/channel/UCjF0OccBT05WxsJb2zNkL4g/playlists
Tutorial Python - Abel Separovich
https://www.youtube.com/user/Oseparovich/playlists
@zeuxisoo
zeuxisoo / git --no-ff settings.txt
Created April 15, 2011 05:06
How do I make git merge's default be --no-ff --no-commit?
git config --global user.name "Your Name"
git config --global core.mergeoptions "--no-ff"
@woosal1337
woosal1337 / classDemo.py
Created July 3, 2021 03:51
GitHub-Copilot-Demo
class Student():
def __init__(self, name, age):
self.name = name
self.age = age
def show(self):
print(self.name)
print(self.age)
def set_age(self, age):
@Guilherme-Marcionilo
Guilherme-Marcionilo / Figura1.kt
Created May 24, 2022 03:40
Exemplos de Destructuring declarations - Kotlin
fun main() {
val pessoa = Pessoa("Gui", 19)
val (nome, idade) = pessoa
println("$nome $idade")
//RESULTADO: Gui 19
}
data class Pessoa(val nome: String, val idade: Int)
@spidy0x0
spidy0x0 / bun-sde-fix-install_script.sh
Last active July 15, 2022 02:52 — forked from zekefeu/bun-sde-fix-install_script.sh
This script automates the installation of the Intel SDE, to fix compatibility issues with older CPU's that do not support the AVX2 instruction set. It fixes the "Illegal hardware instruction" error.
#!/bin/bash
# Solution provided by https://github.com/renhiyama
# (https://github.com/Jarred-Sumner/bun/issues/282#issuecomment-1177154684)
# License agreement
echo "The Intel Software Development Emulator is distributed under the Intel Software License Agreement, available at https://www.intel.com/content/dam/develop/external/us/en/documents/pdf/intel-simplified-software-license-version-august-2021.pdf"
echo ""
echo "If you do not accept the terms of the license agreement, you have 10 seconds to stop this script (Ctrl+C)"
@takanuva
takanuva / agt.h
Last active July 25, 2022 19:57
Simple generic print() and scan() macros
/*******************************************************************************
* Copyright 2022 Paulo Torrens *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy *
* of this software and associated documentation files (the "Software"), to *
* deal in the Software without restriction, including without limitation the *
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or *
* sell copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
@AfonsoArtoni
AfonsoArtoni / fontes-de-vagas.md
Created November 26, 2021 16:39 — forked from lubien/fontes-de-vagas.md
Fontes de vagas (Atualizado 2021-11-22 00:03)