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
import logging | |
from logi_handler import LokiHandler | |
LOKI_URL: str = "http://loki:3100/loki/api/v1/push" # Standard loki url | |
logger = logging.getLogger(__name__) | |
loki_handler = LokiHandler(url=LOKI_URL) |
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
from bs4 import BeautifulSoup | |
import re | |
import urllib3 | |
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | |
class Spider: | |
def __init__(self, url): | |
self.start_url = url |
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
#include "queue.h" | |
#include <fstream> | |
#include <iterator> | |
#include <algorithm> | |
#include <random> | |
std::mutex guard; | |
static std::mt19937 gen{std::random_device{}()}; | |
template <class T> |
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
#include <iostream> | |
#include <cstring> | |
#include <iomanip> | |
#include "wordscounter.h" | |
#define REP(i, n, v) for(int i=v; i<n; i++) | |
#define FOREACH(it, v) for(auto it = v.begin(); it != v.end(); it++) | |
void CheckIfUserAskForHelp(int argc, char ** argv); |
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
from PIL import Image | |
def monochrome(img_name): | |
image = Image.open(img_name) | |
image = image.convert('1') | |
return image | |
def read_pixels(image, x, y): |
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
#include <stdio.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
#include "vm.h" | |
void vm_init(VM *vm, int *code, int code_size, int nglobals){ | |
vm->code = code; | |
vm->code_size = code_size; | |
vm->globals = calloc(nglobals, sizeof(int)); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import random | |
import names | |
import pickle | |
def get_random_surname(): | |
line = random.choice(open("surnames.txt").readlines()) | |
return ''.join(line[0].upper() + line[1:len(line)-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
int diods[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; | |
const int length = 11; | |
#define FOR(x, n) for(int x=0; x<n; x++) | |
void setup() { | |
FOR(x, length){ | |
pinMode(diods[x], OUTPUT); | |
digitalWrite(diods[x], LOW); | |
} |
NewerOlder