Skip to content

Instantly share code, notes, and snippets.

View budgetdevv's full-sized avatar
🤠
Professional Dumbass

TrumpMcDonaldz budgetdevv

🤠
Professional Dumbass
View GitHub Profile
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@lars-tiede
lars-tiede / run_coroutine_in_another_thread.py
Created March 8, 2016 10:37
Safely run a coroutine in another thread's asyncio loop and return the result
import threading
import asyncio
async def run_coro_threadsafe(self, coro, other_loop, our_loop = None):
"""Schedules coro in other_loop, awaits until coro has run and returns
its result.
"""
loop = our_loop or asyncio.get_event_loop()
# schedule coro safely in other_loop, get a concurrent.future back
@migasj
migasj / WindowsSystemErrorCodes.cs
Last active February 17, 2025 15:47
Windows System Error Codes enum (C#)
// Title: An exhaustive enum of all Windows System Error Codes
// Source: https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381.aspx
// Description: Error codes are a means to provide information to outside systems on why a program terminated. This list
// need not be included in its entirety. It is meant to aid in conforming to the existing error code usage.
// See this link form more information on usage. https://msdn.microsoft.com/en-us/library/system.environment.exitcode.aspx
// Note: Internet error codes are excluded from this list. See here: https://msdn.microsoft.com/en-us/library/windows/desktop/aa385465.aspx
// Updated: 2016/10/31
namespace Core
{
DROP DATABASE IF EXISTS 📚;
CREATE DATABASE 📚;
USE 📚;
CREATE TABLE 👤(
🔑 INTEGER PRIMARY KEY,
🗣 varchar(64), -- name
🗓 DATE -- date of registration
@codito
codito / pyembed.c
Last active March 16, 2024 20:29
A simple embedded python interpreter
// Demo a simple embedded python interpreter
// See this post for context: http://codito.in/notes-on-vim-python-interop
//
// Compile with: gcc $(python-config --cflags --ldflags) pyembed.c -o pyembed
// Tested on python 3.6 in arch linux
//
// See https://docs.python.org/3/c-api/init.html for details of APIs.
//
#include <Python.h>
@raveesh-me
raveesh-me / main.dart
Created July 7, 2018 00:22
An inherited callback pattern to change InheritedWidget state in flutter
import 'package:flutter/material.dart';
import 'package:flutter_login_manager/splash_screen.dart';
import 'package:flutter_login_manager/model/login_info.dart';
import 'package:flutter_login_manager/model/login.dart' as loginManager;
import 'package:flutter_login_manager/home_screen.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
@bmaupin
bmaupin / free-database-hosting.md
Last active June 18, 2025 17:12
Free database hosting
@guschmue
guschmue / onnx-allnodes-are-outputs.py
Last active March 6, 2024 03:48
diff onnx models node by node
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import logging
import traceback
import numpy as np
import onnx
@shadeglare
shadeglare / UnionSerialization.cs
Last active February 28, 2025 11:59
Serialize and deserialize a generic union type with System.Text.Json
using System;
using System.Buffers;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text.Json;
using System.Text.Json.Serialization;
using Hexarc.Annotations;
namespace Hexarc.Union
@x1unix
x1unix / NET-framework-standalone-exe.md
Last active March 13, 2025 11:10
[C#] Embed DLL assemblies onto executable

Summary

This guide tells how to embed CLR assemblies (.dll) onto a single executable. This works for WPF, WinForms and console .NET applications.

Source - original article

Project settings

First, we need to add special section to .csproj file to make MSBuild embed referenced assemblies