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
#include <raylib.h> | |
#include <stdlib.h> | |
#include <vector> | |
#include <cmath> | |
#if defined(PLATFORM_WEB) | |
#include <emscripten/emscripten.h> | |
#endif | |
const float pi = 3.14159265358979; |
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
'''A driver for Benewake TFMini time-of-flight distance sensor | |
see: https://cdn.sparkfun.com/assets/1/4/2/1/9/TFmini_Plus_A02_Product_Manual_EN.pdf | |
see: https://www.arduino.cc/reference/en/libraries/tfmini/ | |
Byte0 Byte1 Byte2 Byte3 Byte4 Byte5 Byte6 Byte7 Byte8 | |
0x59 0x59 Dist_L Dist_H Strength_L Strength_H Temp_L Temp_H Checksum | |
Byte0 0x59, frame header, same for each frame | |
Byte1 0x59, frame header, same for each frame |
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
import json | |
import requests | |
import spotipy | |
from spotipy.oauth2 import SpotifyOAuth | |
SPOTIFY_SCOPE = 'playlist-read-collaborative playlist-modify-private playlist-modify-public playlist-read-private' | |
YT_API_KEY = '??' | |
SPOTIFY_CLIENT_ID = '??' | |
SPOTIFY_SECRET = '??' |
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
from tkinter import * | |
from PIL import Image, ImageTk | |
def get_gif_frames(path, speed=33): | |
img = Image.open(path) | |
gif_speed = img.info.get('duration', 0) or speed | |
frames = [] | |
for i in range(img.n_frames): | |
img.seek(i) |
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
""" | |
Deploys local maven repository to a remote one. | |
Requires python 3.x and Maven 3.2.x and higher (lower versions of Maven might work in certain setups, | |
but have issues with SNI). | |
""" | |
import os | |
import os.path as osp | |
import argparse | |
from typing import Dict, List, Union |
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
/** | |
* Async function to wait for true-ish result from `fn`. | |
* Usefull if you are waiting for a global value to be set. | |
* For example: you connect dynamic scipt and wait it to be initialized. | |
*/ | |
export function waitFor<T>( | |
fn: () => T | undefined | null, | |
timeout = 100, // milliseconds | |
maxRetries = 10, | |
signal?: AbortSignal, |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<canvas width="600" height="400"></canvas> |
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
CC = clang | |
CFLAGS = -pedantic -pedantic-errors -Wall -Werror -Wextra | |
LDFLAGS = | |
.PHONY: all | |
all: build_sender build_receiver | |
./sender /shmem1 | |
./receiver /shmem1 | |
.PHONY: build_sender |
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
import numpy as np | |
from PIL import Image | |
import argparse | |
import os | |
from tqdm import tqdm | |
from glob import glob | |
import json | |
from multiprocessing import Pool | |
# pip install numpy pillow tqdm |
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
# Run manually to reformat a file: | |
# clang-format -i --style=file <file> | |
BasedOnStyle: Google | |
ColumnLimit: 100 | |
UseTab: Never | |
SpaceAfterTemplateKeyword: false | |
AllowShortFunctionsOnASingleLine: Empty | |
DerivePointerAlignment: false | |
PointerAlignment: Left |
NewerOlder