Skip to content

Instantly share code, notes, and snippets.

View fernandozamoraj's full-sized avatar

Fernando Zamora fernandozamoraj

View GitHub Profile
@fernandozamoraj
fernandozamoraj / allfiles.cpp
Created February 26, 2022 16:52
ThreeWaysToPrintLinkedListInReverseCPP
//demolinkedlist.cpp
#include <iostream>
template <class N>
class Node{
public:
N data;
Node<N> *next;
};
template <class T>
@fernandozamoraj
fernandozamoraj / gist:f157e1a3e5763d88b01ef71fdcb5b1e8
Last active October 23, 2021 20:55
C Programming Language Cheat Sheet - Everything a C Beginner Needs
//First comment
//#include<...> to include libraries
//#include "myfile.c" to include your own headers
#include <stdio.h> //for printf and such
#include <stdlib.h> //for many definitions TODO more examples
#include <string.h> //for copying strings
#include <ctype.h> //for toupper
//preprocesor directives
//contitional define by using #ifndef and ending with #endif
@fernandozamoraj
fernandozamoraj / CsvParsingSolutionFilesAllInone.cpp
Created September 29, 2021 04:04
Code for creating a generic Csv Parsing Solution in C++
///////////////////////////////////////////////////////////////
// CsvLine.h
#ifndef CSVLINE_H
#define CSVLINE_H
#include <string>
#include <sstream>
#include <vector>
@fernandozamoraj
fernandozamoraj / ParsingDemo.cpp
Created September 29, 2021 02:50
ParsingCsvInCPlusPlus
// ParsingCsvDemo.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include <vector>
using namespace std;
@fernandozamoraj
fernandozamoraj / Cpp11CheatSheet
Last active September 25, 2021 17:54
C++ 11 Cheatshet
//This cheat sheet highlights some important c++11 but not all of them
//To dig deeper I recommend this article
//https://www.codeproject.com/articles/570638/ten-cplusplus11-features-every-cplusplus-developer
//Also look into constexpr and noexcept
//Here is another link
//https://www.w3schools.in/cplusplus11-tutorial/noexcept-keyword/
#include <iostream>
#include <vector>
#include <array>
#include <string>
@fernandozamoraj
fernandozamoraj / compilerun.sh
Created September 25, 2021 08:44
How to compile and run a c++ program from command line
g++ --std=c++11 myprogram.cpp -o myprogram
./myprogram
#This sample power shell was written purely from the motivation of learning powershell
# As there were some goals in mind here is a list of them
# 1. Basic variable declarations
# 2. Creating functions - this goal will require further digging since I could get the parse args function working
# 3. How to get and parse command line arguments - I was able to parse the arguments and use them
# 4. How write output to the display
# 5. How to set color for output on the display
# 6. How to read data from a file
# 7. How to write data to a file
# 8. How to do condition logic - if, gt, lt and -and and -or
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
//this code must be run in an unix env
int main(int argc, char *argv[]){
pid_t pid;
#this is a comment
#this is an array assignment
numbers = [0,1,2,3,4,3,5,6,7,8]
#this is an array assignment from a range
puts "*****Numbers******"
numbers.each{|number| puts number}
import urllib.request
import ctypes
import time
from datetime import datetime
page_name = "my page" #change to what you want your message to display
page_url = "https://www.google.com" #change to your website...
start_time = datetime.now();
failure_count = 0