Skip to content

Instantly share code, notes, and snippets.

View Owlree's full-sized avatar
🏄‍♂️
🐦

Robert Badea Owlree

🏄‍♂️
🐦
View GitHub Profile
@Owlree
Owlree / dark-mode.js
Last active January 26, 2026 11:25
PDF.js dark mode filters
const invert = (contrast, invert, sepia, brightness) => {
const existingStyle = document.getElementById('dark-mode');
let style = document.createElement("style");
if (existingStyle) {
style = existingStyle;
} else {
stye = document.createElement('style');
style.id = 'dark-mode';
document.head.appendChild(style);
}
let bars = document.getElementsByClassName('ytd-thumbnail-overlay-resume-playback-renderer');
let result = '';
for (barIndex in bars) {
let bar = bars[barIndex];
if (!bar) continue;
if (!bar.style) continue;
let progress = parseFloat(bar.style.width) / 100.0;
if (progress < 1) {
let root = bar.parentElement.parentElement.parentElement.parentElement.parentElement;
let meta = root.querySelector('#video-title');
#include <chrono>
#include <condition_variable>
#include <iostream>
#include <mutex>
#include <thread>
int main() {
std::mutex myMutex;
#include <iostream>
#include <thread>
#include <vector>
int main() {
typedef std::vector<std::thread>::size_type vsize;
@Owlree
Owlree / file_size.c
Last active December 19, 2017 01:47
#include <dirent.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
void fail(const char *path) {
fprintf(stderr, "Error while processing %s, ignoring\n", path);
version: '3'
services:
hoottit:
image: hoottit
container_name: "hoottit"
environment:
- HOOT_MONGO=mongodb://mongo:27017/hoot
links:
- mongo
depends_on:
@Owlree
Owlree / kindom-division-normal.cpp
Last active July 13, 2017 11:26
Solution for the Kingdom Division problem on HackerRank—normal form version.
#include <iostream>
#include <vector>
using namespace std;
vector<int> graph[100005];
const int MOD = 1000000007;
long long memf[100005];
long long memg[100005];
@Owlree
Owlree / kingdom-division-short.cpp
Last active May 9, 2019 17:47
Solution for the Kingdom Division problem on HackerRank—the short version.
#include <iostream>
#include <vector>
using namespace std;
vector<int> graph[100005];
long long mem[100005][2][2];
const int MOD = 1000000007;
@Owlree
Owlree / kingdom-division-long.cpp
Last active March 23, 2019 15:00
Solution for the Kingdom Division problem on HackerRank.
#include <iostream>
#include <map>
#include <set>
#include <tuple>
#include <queue>
using namespace std;
const long long MOD = 1000000007;
@Owlree
Owlree / My VIMRC
Created April 19, 2017 02:23
The way I code.
set cc=80
set runtimepath^=~/.vim/bundle/ctrlp.vim
set expandtab
set textwidth=120
set tabstop=4
set softtabstop=4
set shiftwidth=4
set autoindent
set relativenumber