Skip to content

Instantly share code, notes, and snippets.

View lglista's full-sized avatar
🤠

Lawrence Glista lglista

🤠
View GitHub Profile
@lglista
lglista / stackGrowth.cpp
Created January 24, 2024 18:58
Find out whether the stack grows up or down
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
int* first;
int* second;
if (&first > &second)
cout << "Stack grows down" << endl;
@lglista
lglista / _Newline_Separated_Lists_Of_Elder_Scrolls_NPC_Names.txt
Last active September 27, 2022 22:28
Newline separated lists of all names in the video game series The Elder Scrolls
This gist contains files that have names used by in game characters in The Elder Scrolls.
Taken from https://en.uesp.net/wiki/Lore:Names
They are separated by newlines.
They are separated by race and gender.
These are up to date as of Sep 26th, 2022; before Elder Scrolls 6 has been released.
@lglista
lglista / example_usage.py
Created March 15, 2022 16:17
python3 Observer Pattern (Publisher/Subscriber pattern)
from pubsub import PubSub
from test_classes import Test1, Test2, print_string, add_number
def main():
bus = PubSub()
test1 = Test1("hello")
test2 = Test2(2)
bus.subscribe(print_string, Test1)
@lglista
lglista / eso_alchemy_ingredients_list.tsv
Created November 5, 2021 20:35
Tab separated list of ESO alchemy ingredients with effects
Beetle Scuttle Breach Increase Armor Protection Vitality
Blessed Thistle Restore Stamina Increase Weapon Power Ravage Health Speed
Blue Entoloma Ravage Magicka Cowardice Restore Health Invisible
Bugloss Increase Spell Resist Restore Health Cowardice Restore Magicka
Butterfly Wing Restore Health Lingering Health Uncertainty Vitality
Clam Gall Increase Spell Resist Hindrance Vulnerability Defile
Columbine Restore Health Restore Magicka Restore Stamina Unstoppable
Corn Flower Restore Magicka Increase Spell Power Ravage Health Detection
Dragonthorn Increase Weapon Power Fracture Restore Stamina Weapon Critical
Emetic Russula Ravage Stamina Ravage Health Ravage Magicka Entrapment
@lglista
lglista / oblivion_alchemy_ingredients_list.tsv
Last active November 5, 2021 18:16
Tab separated list of Oblivion alchemy ingredients with effects
Alkanet Flower Restore Intelligence Resist Poison Light Damage Fatigue
Alocasia Fruit Damage Magicka Light Restore Fatigue Restore Health
Aloe Vera Leaves Restore Fatigue Restore Health Damage Magicka Invisibility
Ambrosia Restore Health - - -
Apple Restore Fatigue Damage Luck Fortify Willpower Damage Health
Arrowroot Restore Agility Damage Luck Fortify Strength Burden
Ashen Remains Damage Luck Fortify Fatigue Silence Weakness to Fire
Aster Bloom Core Burden Dispel Restore Agility Shield
Beef Restore Fatigue Shield Fortify Agility Dispel
Bergamot Seeds Resist Disease Dispel Damage Magicka Silence
@lglista
lglista / skyrim_alchemy_ingredients_list.tsv
Created November 5, 2021 16:27
Tab separated list of Skyrim alchemy ingredients with effects
Abecean Longfin Weakness to Frost Fortify Sneak Weakness to Poison Fortify Restoration
Ancestor Moth Wing Damage Stamina Fortify Conjuration Damage Magicka Regen Fortify Enchanting
Ash Creep Cluster Damage Stamina Invisibility Resist Fire Fortify Destruction
Ash Hopper Jelly Restore Health Fortify Light Armor Resist Shock Weakness to Frost
Ashen Grass Pod Resist Fire Weakness to Shock Fortify Lockpicking Fortify Sneak
Bear Claws Restore Stamina Fortify Health Fortify One-Handed Damage Magicka Regen
Bee Restore Stamina Ravage Stamina Regenerate Stamina Weakness to Shock
Beehive Husk Resist Poison Fortify Light Armor Fortify Sneak Fortify Destruction
Bleeding Crown Weakness to Fire Fortify Block Weakness to Poison Resist Magic
Blisterwort Damage Stamina Frenzy Restore Health Fortify Smithing
@lglista
lglista / morrowind_alchemy_ingredients_list.tsv
Last active November 5, 2021 16:32
Tab separated list of Morrowind alchemy ingredients with effects
Alit Hide Drain Intelligence Resist Poison Telekinesis Detect Animal
Ampoule Pod Water Walking Paralyze Detect Animal Drain Willpower
Ash Salts Drain Agility Resist Magicka Cure Blight Disease Resist Magicka
Ash Yam Fortify Intelligence Fortify Strength Resist Common Disease Detect Key
Bittergreen Petals Restore Intelligence Invisibility Drain Endurance Drain Magicka
Black Anther Drain Agility Resist Fire Drain Endurance Light
Black Lichen Drain Strength Resist Frost Drain Speed Cure Poison
Bloat Drain Magicka Fortify Intelligence Fortify Willpower Detect Animal
Bonemeal Restore Agility Telekinesis Drain Fatigue Drain Personality
Bread Restore Fatigue - - -
@lglista
lglista / Timer.cpp
Last active August 30, 2021 14:43
c++11+ Timer using a Singleton pattern
// See https://en.wikipedia.org/wiki/Singleton_pattern for singleton pattern description
/**
Author: Lawrence Glista
Singleton pattern to time your program
Timing comes at a cost, your program will run slower while it is being timed
*/
#include "Timer.h"
using namespace std;
@lglista
lglista / Options.cpp
Last active August 30, 2021 14:40
c++11+ get command line options that are set using a singleton pattern
// See https://en.wikipedia.org/wiki/Singleton_pattern for singleton pattern description
/**
Author: Lawrence Glista
Singleton pattern for setting command line options such as -v, --verbose
*/
#include "Options.h"
using namespace std;
Options& Options::Instance()
@lglista
lglista / load_structure_from_file.py
Last active August 30, 2021 14:33
Python 3.8+ Save and Load objects from file
import pickle # https://docs.python.org/3/library/pickle.html
def load_structure_from_file(filename, structure):
"""Return an object saved in a file. Does not guarantee that the object returned is the same type as structure.
Return a default constructed structure if it could not load an object from the file.
Keyword Arguments:
filename -- the file to open. Full paths work the best
structure -- the data structure to return if the file could not be loaded. Must have a default constructor.
"""