Skip to content

Instantly share code, notes, and snippets.

import os
import openai
from gtts import gTTS
import vlc
class bcolor:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
@idimiter
idimiter / peek.cpp
Last active March 7, 2020 15:04
Peek
#include <iostream>
#include <cassert>
#include <gtk/gtk.h>
#include <gdk/gdkscreen.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <cairo.h>
static GtkWidget *window;
static GdkPixbufAnimation *pixbuf_animation;
@idimiter
idimiter / anagram.cpp
Created June 7, 2017 05:28
Simple anagram solver
#include <iostream>
#include <algorithm>
#include <vector>
int main(int ac, char* av[]) {
std::vector<std::string> permlist = {"test", "This", "is"};
if (ac > 1) {
permlist.clear();
#include <stdio.h>
#include <math.h>
float kyp(float t, float kypLength) {
return fabs( sin(t * 9.45) * ((t > 0.33 && t < 0.66)? kypLength : 1) );
}
float easeIn(float t, float strength) {
return pow(t, strength);
}
@idimiter
idimiter / public_key.c
Last active May 29, 2017 19:35
Basic Public/Private key example in C
#include <stdio.h>
#include <string.h>
const int publicKey = 42;
const int privateKey = 256 - publicKey;
const int m = publicKey + privateKey;
void scramble(char* s, int key) {
for (size_t i = 0; i < strlen(s);i++)
s[i] = (s[i] + key) % m;
@idimiter
idimiter / 3dascii.c
Last active May 8, 2017 16:57
basic 3D object draw in terminal
// Dimitar T. Dimitrov 2017
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
const int width = 64;
const int height = 64;
char screen[width * height];
#ifndef TOTO_EDITIONS_DIMITAR_TDIMITROV
#define TOTO_EDITIONS_DIMITAR_TDIMITROV 1
#include <vector>
struct Edition {
float year;
float index;
int numbers[6];
@idimiter
idimiter / bash_fun.c
Created June 15, 2016 07:17
Having some fun with the bash escape sequences
/*
* bash_fun.c
*
* Dimitar T. Dimitrov
* 15.06.2016
*
*/
#include <sys/ioctl.h>
#include <unistd.h>
#include <stdio.h>
@idimiter
idimiter / unet_udp.c
Last active May 26, 2016 18:18
Unity Transport UDP Layer basic echo server
//
// unet_udp.c
// Unity Transport UDP Layer basic echo server
//
// Created by Dimitar Dimitrov on 12/27/15.
// Copyright © 2015 Dimitar Dimitrov. All rights reserved.
//
#include <stdlib.h>
#include <stdio.h>