Skip to content

Instantly share code, notes, and snippets.

View MessiDaGod's full-sized avatar

MessiDaGod MessiDaGod

  • Southern California
View GitHub Profile
@MessiDaGod
MessiDaGod / GetAssemblyTypes.cs
Created July 27, 2022 17:24
Get all types of a certain name from assembly C#
public List<Type>? GetAssemblyTypes(string typeName, string assemblyName = "Shakely")
{
List<Assembly> allAssemblies = new List<Assembly>();
List<Type> allTypes = new List<Type>();
string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
for (int i = 0; i < Directory.GetFiles(path, $"{assemblyName}*.dll").ToArray().Length; i++)
{
var dll = Assembly.LoadFile(Directory.GetFiles(path, $"{assemblyName}*.dll").ToArray()[i]);
allAssemblies.Add(dll);
@MessiDaGod
MessiDaGod / IsNumeric.cs
Created July 27, 2022 17:21
Is a field/type numeric C#
private static HashSet<Type> NumericTypes = new HashSet<Type>
{
typeof(decimal), typeof(byte), typeof(sbyte), typeof(double)
,typeof(short), typeof(ushort), typeof(Single), typeof(UInt16)
,typeof(Int16), typeof(Int32), typeof(UInt32),typeof(UInt64)
,typeof(Int64), typeof(float)
};
public static bool IsNumeric(Type type)
{
set dateObj to (current date)
set theMonth to month of dateObj as number
set theDay to day of dateObj
set theYear to year of dateObj
set dateStamp to "" & theMonth & theDay & theYear
dateStamp
set dFolder to "~/Documents/MoveCU/ScreenCaptures/" & dateStamp & "/"
do shell script ("mkdir -p " & dFolder)
@MessiDaGod
MessiDaGod / index.html
Created June 3, 2022 15:23
Tic Tac Toe
<div id="errors" style="
background: #c00;
color: #fff;
display: none;
margin: -20px -20px 20px;
padding: 20px;
white-space: pre-wrap;
"></div>
<div id="root"></div>
<script>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>chart</title>
<head>
<body>
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install gcc g++ make
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
/*
{
"name": "example.com",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"start": "http-server"
},
import os
for root, dirs, files in os.walk("D:\\Repos\\YahooApi"):
for file in files:
if file.endswith(".csproj"):
print(os.path.join(root, file))
var appBanners = document.getElementsByClassName("bling css-zvcs3w");
for (var i = 0; i < appBanners.length; i++) {
appBanners[i].style.display = "none";
}