Skip to content

Instantly share code, notes, and snippets.

@ludolara
ludolara / asyncJs.js
Created May 24, 2018 13:01
Cheat Sheet de Javascript asíncrono
/*
function handleError(err){
console.log('Request falied'+ err)
}
//Promise
function get(url){
return new Promise((resolve, reject) => {
var xhrObject = new XMLHttpRequest();
xhrObject.onreadystatechange = function() {
@ludolara
ludolara / SuperScript
Last active February 23, 2021 23:44 — forked from MILKTON/SuperScript
Abrir "aquí" PowerShell como administrador
$menu = 'Administrator PowerShell'
$command = "$PSHOME\powershell.exe -NoExit -Command ""Set-Location '%V'"""
'directory', 'directory\background', 'drive' | ForEach-Object { New-Item -Path "Registry::HKEY_CLASSES_ROOT\$_\shell" -Name runas\command -Force | Set-ItemProperty -Name '(default)' -Value $command -PassThru | Set-ItemProperty -Path {$_.PSParentPath} -Name '(default)' -Value $menu -PassThru | Set-ItemProperty -Name HasLUAShield -Value '' }
#EXTM3U
#EXTINF:-1 tvg-id="ADN40.mx" tvg-logo="https://i.imgur.com/Og17U9N.png" group-title="News",ADN 40
https://mdstrm.com/live-stream-playlist/60b578b060947317de7b57ac.m3u8
#EXTINF:-1 tvg-id="AlcanceTV.mx" tvg-logo="https://i.imgur.com/5nYjRlb.png" group-title="Religious",Alcance TV
https://5bf8041cb3fed.streamlock.net/AlcanceTV/AlcanceTV/playlist.m3u8
#EXTINF:-1 tvg-id="AMXNoticias.mx" tvg-logo="https://i.imgur.com/snIU1UA.jpg" group-title="News",AMX Noticias
https://5e50264bd6766.streamlock.net/mexiquense2/videomexiquense2/playlist.m3u8
#EXTINF:-1 tvg-id="AntenaTV.mx" tvg-logo="https://i.imgur.com/1sAgSME.png" group-title="General",Antena TV
https://5ca9af4645e15.streamlock.net/grd/videogrd/playlist.m3u8
#EXTINF:-1 tvg-id="AztecaUno.mx" tvg-logo="https://i.imgur.com/rRxgBtI.png" group-title="General",Azteca Uno
import unittest
class MarsRover():
def __init__(self, facing, x, y, planet_map) -> None:
self.facing: str = facing
self.x: int = x
self.y: int = y
self.planet_map: Planet = planet_map
self.compass: list[str] = ["N", "E", "S", "W"]
self.obstacle_detected: bool = False
class Gossip:
def __init__(self, message):
if not isinstance(message, str):
raise TypeError("Gossip message must be a string.")
self.message = message
class BusRoute:
def __init__(self, stops: list[int]):
if not isinstance(stops, list) or not all(isinstance(stop, int) for stop in stops):
raise ValueError("Stops must be a list of integers.")