Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View cubedtear's full-sized avatar

Aritz Lopez cubedtear

  • Donostia, Basque Country
View GitHub Profile
function contieneUnMes_(str) {
const meses = ["enero", "febrero", "marzo", "abril",
"mayo", "junio", "julio", "agosto",
"septiembre", "octubre", "noviembre", "diciembre"];
return meses.indexOf(str.split(" ")[0]) > -1;
}
function createMonthArray_() {
var result = [];
for (var a = 0; a<31; a++) result.push(0);
@cubedtear
cubedtear / script.sh
Last active July 7, 2023 04:37
Self-updating bash script
#!/usr/bin/env bash
VERSION="0.0.2"
SCRIPT_URL='https://gist.github.com/cubedtear/54434fc66439fc4e04e28bd658189701/raw'
SCRIPT_DESCRIPTION=""
SCRIPT_LOCATION="${BASH_SOURCE[@]}"
rm -f updater.sh
function update()
{
@cubedtear
cubedtear / lumberjack.py
Last active September 4, 2020 19:04
Bot that plays Telegram Lumberjack (https://tbot.xyz/lumber)
from time import sleep # Bot for https://tbot.xyz/lumber
from mss import mss
from pyautogui import press
actions = ['left']
sleep(2)
with mss() as sct:
while True:
color = sct.grab({'top': 440, 'width': 4, 'left': 517, 'height': 150}).rgb
actions.append('left' if any(map(lambda x: color[x] > max(color[x+1:x+2]), range(0, len(color), 3))) else 'right')
action = actions.pop(0)
grammar FleetLang;
program
: tlds+=topLevelDecl* EOF
;
topLevelDecl
: function
| typeDecl
| declaration stmtEnd
void myprint(*i8 str, int length) {
syscall3(1, 1, (int)str, length);
}
void exit(int code) {
syscall1(60, code);
}
import requests
from lxml import html, etree
item_prices = []
for page in range(1, 10):
r = requests.get('https://www.chollometro.com/nuevos', {'page': str(page), 'ajax': 'true'})
res = html.fromstring(r.text)
items = res.xpath('//div[contains(@class, "threadCardLayout--card")]')
// Group members:
//
// - Iñigo Arnedo
// - Elena Hernandez
// - Aritz Lopez
// - Ane Odriozola
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
@cubedtear
cubedtear / Test.md
Last active December 21, 2017 23:06

Azken entregarako egin beharreko atalak:

  • Galderak ezabatu ahal izatea.

Ariketa hau egiteko, Reviewing Quizes atalean, galdera bat editatzeko aukeratzean, botoi bat agertzen da, galdera hori ezabatzeko.

Behar izandako denbora: 15 minutu.

ATAI: Homework 2

Task 1: Include more indeterminism in the environment

a) Randomly scattering some pieces of garbage on the grid.

private MarsModel() {
    // ...
.coursebox .content .teachers {
width: 100%;
}
.coursebox {
padding: 0;
margin-bottom: 0;
border: none;
}