Skip to content

Instantly share code, notes, and snippets.

syntax enable
" https://github.com/sainnhe/everforest
colorscheme everforest
set background=dark
set guifont=Source_Code_Pro_SemiBold:h12
set guicursor+=a:blinkon0
set guioptions-=m
set guioptions-=T
set guioptions -=r
@injust90
injust90 / diagonal_algorithm.cpp
Last active December 26, 2022 21:42
Cross counting X pattern in a vector
#include <iostream>
#include <vector>
using namespace std;
// Defining rows and columns of
// vector of vectors
int main()
{
int diagonalRight = 0;
@injust90
injust90 / smoke.cfg
Created December 22, 2022 22:18
smoke practice for cs:go
sv_cheats 1;
bot_kick;
mp_warmup_end;
mp_freezetime 0;
mp_roundtime_defuse 60;
sv_grenade_trajectory 1;
sv_grenade_trajectory_time 10;
sv_showimpacts 1;
ammo_grenade_limit_total 5;
sv_infinite_ammo 1;
@injust90
injust90 / Game.h
Last active December 1, 2022 05:11
#include <SDL2/SDL.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_ttf.h>
#include <SDL2/SDL_mixer.h>
@injust90
injust90 / Makefile
Created November 28, 2022 22:10
Makefile template
# OBJS declares the files to be compiled
OBJS = Main.cpp Game.cpp
# CC declares the compiler (GCC)
CC = g++
# COMPILER_FLAGS declares the additional compilation options
# -w suppresses warnings
COMPILER_FLAGS = -w
#include <stdio.h>
#include <string>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_ttf.h>
#include <SDL2/SDL_mixer.h>
const int SCREEN_WIDTH = 1280;
const int SCREEN_HEIGHT = 960;
#include "CircleComponent.h"
#include "Actor.h"
CircleComponent::CircleComponent(class Actor* owner)
:Component(owner)
, mRadius(0.0f)
{
}
int lonelyinteger(vector<int> a) {
int result = 0;
// for each element if result is equal to start of line then result is set to that value.
for (int i : a)
{
result = result ^ i;
}
return result;
@injust90
injust90 / PrintFullPath.cpp
Created September 23, 2022 23:23
Used to print the working directory
void PrintFullPath(const char* partialPath)
{
char full[_MAX_PATH];
if (_fullpath (full, partialPath, _MAX_PATH) != NULL)
printf("Full path is %s\n", full);
else
printf("Invalid path\n" );
}
int main()
@injust90
injust90 / arrowandclass.js
Created April 7, 2020 17:42
Arrow function expressions and classes
function Fruit (type) {
this.type = type;
this.color = 'unknown';
this.getInformation = function() {
return 'This ' + this.type + ' is ' + this.color + '.';
}
}
function Fruit2(type) {
this.type = type;