This file contains 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
//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"); |
This file contains 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
__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) |
This file contains 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
__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 |
This file contains 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
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 |
This file contains 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
git config --global user.name "Your Name" | |
git config --global core.mergeoptions "--no-ff" |
This file contains 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
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): |
This file contains 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
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) |
This file contains 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
#!/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)" |
This file contains 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
/******************************************************************************* | |
* 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: * | |
* * |
OlderNewer