This file contains hidden or 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
document.addEventListener('keydown', function(event) { | |
if (event.ctrlKey && event.code === 'Space') { | |
document.querySelector('video').currentTime = document.querySelector('video').duration; | |
event.preventDefault(); | |
} | |
}); |
This file contains hidden or 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 | |
if [ -z $OPENAI_API_KEY ]; | |
then | |
echo "Missing define OPENAI_API_KEY" | |
exit 1 | |
fi | |
function chat() { |
This file contains hidden or 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
window.translator = setInterval(() => { | |
document.querySelectorAll('[data-testid="tweetText"][lang="en"]').forEach(tweetText => { | |
const parent = tweetText.parentNode; | |
const translateButton = parent.querySelector('button span'); | |
if (translateButton && translateButton.textContent.includes("Traducir post")) { | |
translateButton.closest('button').click(); | |
console.log(translateButton) | |
tweetText.style.color = "#555"; | |
} |
This file contains hidden or 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
let powerstatus = "0"; | |
let lastPowerstatus = "0"; | |
const waitForChange = (timeout: number) => { | |
return new Promise<string>((resolve) => { | |
const start = Date.now(); | |
const interval = 100; | |
const check = () => { | |
if (powerstatus !== lastPowerstatus) { |
This file contains hidden or 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 | |
echo "Vamos a actualizar Discord" | |
if [ "$1" != "-y" ]; | |
then | |
read -n 1 -s -r -p "Presiona cualquier tecla para continuar..." | |
echo | |
fi |
This file contains hidden or 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
#!/usr/bin/env python | |
""" | |
Run this code under the Python interpreter. | |
""" | |
import os | |
import random | |
import re | |
import openai |
This file contains hidden or 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
const express = require('express'); | |
const { | |
exec, | |
} = require('child_process'); | |
const app = express(); | |
const port = 7000; | |
let isRunning = false; |
This file contains hidden or 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
// This | |
// Use this for math.div(number, divider) function | |
@use "sass:math" | |
// The sqrt function, just to calc sqrt(3) ._. | |
// Source: https://www.antimath.info/css/sass-sqrt-function/ | |
@function sqrt($r) | |
$x0: 1 | |
$x1: $x0 |
This file contains hidden or 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
#!/usr/bin/python3 | |
# -*- coding: utf-8 -*- | |
from numpy import pi, array, full, uint8 | |
import imageio | |
import matplotlib.pyplot as plt | |
theta = 0.5 # valor entre [0,1) | |
light = 1 # valor entre [0,1) |
This file contains hidden or 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
const L = 37, R = 39, U = 38, D = 40; | |
let a = [ | |
[L, U, R, D], [L, D, R, U], | |
[R, U, L, D], [R, D, L, U], | |
[U, L, D, R], [U, R, D, L], | |
[D, L, U, R], [D, R, U, L] | |
]; | |
let d = document; | |
let c = d.getElementsByTagName("canvas")[0]; | |
let gdir = () => { return a[Math.floor(Math.random() * a.length)]; } |
NewerOlder