Skip to content

Instantly share code, notes, and snippets.

@martinandersen3d
martinandersen3d / bootstrap-all-elements.html
Created January 9, 2023 20:46 — forked from letanure/bootstrap-all-elements.html
List of all bootstrap components
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap all elements</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
@martinandersen3d
martinandersen3d / DownloadAndShowImages.dib
Created November 21, 2022 22:48 — forked from AlRado/DownloadAndShowImages.dib
Downloads and displays images from the WEB
#!csharp
using System.Collections.Generic;
using System.Linq;
using Microsoft.DotNet.Interactive;
using Microsoft.DotNet.Interactive.Formatting;
using static Microsoft.DotNet.Interactive.Formatting.PocketViewTags;
void downloadAndShowImages(params string[] urls) {
display(span(urls.Select(url =>
@martinandersen3d
martinandersen3d / 00-Using_SQLite.dib
Created November 21, 2022 22:47 — forked from fravelgue/00-Using_SQLite.dib
Interactive (Polyglot) Notebook using SQLite
#!markdown
# Using SQLite in Notebook
Install ExtensionLab NuGet package
#!csharp
#r "nuget: System.Data.SQLite, *-*"
#r "nuget: Microsoft.DotNet.Interactive.ExtensionLab, *-*"
#!markdown
Records in C#
#!csharp
public class Course
{
public string Name {get; set;}
public string Author {get; set;}
using System.Collections.Generic;
using System.Linq.Expressions;
namespace System.Linq
{
public static class QueryableHelper
{
public static IQueryable<TEntity> Search<TEntity>(this IQueryable<TEntity> query, string searchValue, params Expression<Func<TEntity, string>>[] propertiesToSearch)
{
if (string.IsNullOrEmpty(searchValue)) return query;
@martinandersen3d
martinandersen3d / Args.cs
Created November 5, 2022 22:52 — forked from josheinstein/Args.cs
Argument Validation Helper (C#)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
/// <summary>
/// Provides methods for checking method arguments for validity and throwing localizable exceptions for invalid
/// arguments or argument combinations.
using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.Globalization;
public static partial class StringExtensions
{
public static sbyte ToSByte(this string s)
{

using System;
using System.Linq;
using System.Text;
using System.Globalization;
namespace TextDataUtility
{
public static partial class StringExtensions
{
@martinandersen3d
martinandersen3d / Fundamentals---ORM.cs
Created October 7, 2022 10:49 — forked from bbrt3/Fundamentals---ORM.cs
Entity Framework Core
/*
ORM (Object-Relational Mapping) allows us to have a framework
for storing objects within relational databases and translating between
DATABASE-CODE communication.
What is ORM?
1. Object relational mapping is a technique for storing,
retrieving, updating and deleting (CRUD) from
an object-oriented program in a relational database.
2. Utilization of "data layer" to manage translation between the OO and relational