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
/// mime = "0.3.0" | |
/// image = "0.24.0" | |
/// ffmpeg-next = "5.0.2" | |
extern crate ffmpeg_next as ffmpeg; | |
use image::{ImageBuffer, Rgb}; | |
use ffmpeg::{ | |
util::frame::video::Video, | |
format::{input, Pixel}, |
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 <string> | |
#include <sys/stat.h> | |
#ifdef _WIN32 | |
#include <direct.h> | |
#define MKDIR(PATH) ::_mkdir(PATH) | |
#else | |
#define MKDIR(PATH) ::mkdir(PATH, 0755) | |
#endif |
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
CXX=c++ | |
CXXFLAGS=-std=c++11 -pipe -pedantic -O3 -Wall | |
PREFIX=/usr/local | |
INCLUDE=-I. -I./include | |
LDFLAGS= | |
BIN=bin | |
BUILD_DIR=./build | |
CPP=$(wildcard src/*.cpp) |
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 <string.h> | |
#include <stdlib.h> | |
#include <dirent.h> | |
#include <sys/stat.h> | |
#include <errno.h> | |
#include <zip.h> |
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
-- usage | |
-- quitegood test_size tolerance | |
import System.Environment | |
import Data.List | |
getDivisors :: Int -> [Int] | |
getDivisors n = | |
(1:) $ nub $ concat [ [x, div n x] | x <- [2..limit], rem n x == 0 ] | |
where limit = (floor.sqrt.fromIntegral) n |
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
/* taken from http://www.strudel.org.uk/itoa/ | |
cannot handle negative numbers */ | |
char* itoa(int val, int base){ | |
static char buf[32] = {0}; | |
int i = 30; | |
for(; val && i ; --i, val /= base) | |
buf[i] = "0123456789abcdef"[val % base]; | |
return &buf[i+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
/* functions to get html, store it and it's information in a structure and parse them. | |
* alot of this was taken from | |
* https://curl.se/libcurl/c/CURLOPT_WRITEFUNCTION.html | |
* I just wanted to modify it a little for my own purposes | |
* compile with "gcc curl_write-callback-and-parse.c -lcurl" | |
*/ | |
#include <curl/curl.h> | |
#include <stdlib.h> |
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 <unistd.h> | |
#include <sys/wait.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#define PROCESS "/bin/ls" | |
#define ARGV "ls", "-la" | |
void main(void) { | |
// fd is the file descriptor for input and output |