Skip to content

Instantly share code, notes, and snippets.

View sidewinder040's full-sized avatar
๐Ÿ™‚

Mark Crouch sidewinder040

๐Ÿ™‚
  • Bedfordshire, England
View GitHub Profile
@sidewinder040
sidewinder040 / enums3.rs
Created April 22, 2021 22:10
Rustlings enums3.rs - Solved
// enums3.rs
// Address all the TODOs to make the tests pass!
// Solved by refering to other peoples attempts, then by trial & error
// Passes all the tests.
enum Message {
// TODO: implement the message variant types based on their usage below
ChangeColor((u8, u8, u8)),
Echo(String),
@sidewinder040
sidewinder040 / safe-input.c
Created January 2, 2021 19:45
A safer way to get user data, limited to size of Buffer
// A safer way to get user data, limited to size of Buffer
#include <stdio.h>
#define BUFFER_SIZE 15
int main(int argc, char const *argv[])
{
printf("Please enter your name: ");
char name[BUFFER_SIZE];
fgets(name, sizeof(name), stdin);
@sidewinder040
sidewinder040 / StaticVector
Created October 17, 2020 13:52
C++ Static Vector Class
#include <iostream>
#include <vector>
using namespace std;
class List
{
private:
static vector<int> Numbers;
public:
colorscheme delek
:let mapleader = " "
set timeout timeoutlen=500 " Set timeout length to 500 ms
function! ToggleLineNumber()
if v:version > 703
set norelativenumber!
endif
set nu!
@sidewinder040
sidewinder040 / update-isos.sh
Last active August 7, 2020 17:10
Daily ISO Updater for Ubuntu Desktop and Derivatives
#! /bin/bash
# M. Crouch 09/03/2020 - Inspiration by Popey Youtube channel
# Command Arg: Date string eg. 20200309
# Refer to http://iso.qa.ubuntu.com/qatracker/milestones/408/builds for date string
# Check for argument
if [ "$1" == "" ]
then
echo "You must provide the date of the image."
echo "I.e <20200309>"