Skip to content

Instantly share code, notes, and snippets.

View DreamVB's full-sized avatar
🏠
Working from home

Ben DreamVB

🏠
Working from home
View GitHub Profile
// A simple stack class using templates.
// Version 1
// By Ben J
#include <iostream>
using namespace std;
template <typename T, int s_size>
class TMyStack{
@DreamVB
DreamVB / rndpws.cs
Created August 17, 2018 20:35
Random password class in C#
/* Random Password Class
* This example shows how to create a list of random passwords.
* By DreamVB on 21:28 17/08/2018
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PasswordGenerator;
@DreamVB
DreamVB / quiz.c
Created July 9, 2019 20:07
Simple Computer Quiz
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
char *questions[10][5] = {
{ "What is the smallest unit in the computer system.", "Block", "Byte", "Bit", "C" },
{ "What is the most widely used device in the computer..", "Solid state disks", "Mouse", "Hard drive", "C" },
{ "WWW stands for.", "Wan Wide World.", "World Wide Web", "Wide Wan Web", "B" },
{ "What software is used to view web pages.", "Internet", "Web Browser", "Page Browser", "B" },
{ "Which one is a word processor.", "Notepad.", "Excel", "Word Perfect", "C" },
@DreamVB
DreamVB / bcrypt.c
Created July 9, 2019 20:10
Good File Encryption With Password.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char **argv)
{
FILE *infile;
FILE *outfile;
char ch = '\0';
char newch = '\0';
@DreamVB
DreamVB / vm.c
Last active February 2, 2026 11:54
Simple Stack Virtual Machine in C
/*
Simple stack Virtual Machine
Version 1.0
by DreamVB
This is a simple example of how to code a simple VM in C
At the moment this vm only supports a small amount of instruction I hope to add more as I learn more.
This version has some hard coded example that you can test in the vm. Next version I plan to load the examples from files.
If you like this code, or if you have some improvements I can make drop me a message below:
@DreamVB
DreamVB / bpwsgen.c
Last active July 18, 2019 11:01
Strong Password Generator CLI
/*
Strong Password Generator
Version 1.0b
by DreamVB
This file may be distributed under the terms of the GNU Public License.
*/
#include <stdio.h>
#include <stdlib.h>
@DreamVB
DreamVB / main.c
Last active July 31, 2019 21:11
Simple Quick Recursive Descent Parser
/*
Recursive Descent Parser
by DreamVB
*/
#include <stdio.h>
#include <stdlib.h>
#define MAX_TOKEN 255
@DreamVB
DreamVB / rpn.py
Created September 22, 2019 18:09
Reverse Polish Notation Python Version
# Reverse Polish notation demo
# Basic calulator for RPN expression only + / * - is supported.
# Allows ints and floats.
import math
stack = []
def IsNuber(s):
is_num = True
for n in s:
@DreamVB
DreamVB / backup.sh
Created May 18, 2020 20:23
A simple Bash Script I made To Backup My Files.
#!/bin/bash
SRCDIR="files"
#Set to 1 to delete backup files older than 30 days. otherwise set to zero
RemoveOldBackups=1
#Set a filename based on date and time.
FILENAME=$(date +"%FT%H%M%S").tgz
#Make backup folder
mkdir -p "Backups"
#This is the backed up filename.
BACKUP_FILE="Backups/$FILENAME"
@DreamVB
DreamVB / ts.c
Last active May 28, 2020 19:46
Simple Text Statistics tool
// File : ts.c
// By : Ben a.k.a DreamVB
// Date : 20:50 26/05/2020
// Info : Little tool to count the Lines, Digts Words, Chars, UpperCase and LowerCase chars in a file.
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
int m_words = 0;