Skip to content

Instantly share code, notes, and snippets.

View ernado-x's full-sized avatar
🐈
Meow meow meow

Andrew Gubskiy ernado-x

🐈
Meow meow meow
View GitHub Profile
class Poem
{
public async Task Execute()
{
House house = new House();
CherryOrchard orchard = new CherryOrchard(house);
Beetles beetles = new Beetles();
Plowmen plowmen = new Plowmen();
orchard.NearHouse();
@ernado-x
ernado-x / sitemap-complex-example.cs
Created November 3, 2021 11:07
X.Web.Sitemap Complex Example
public class SitemapGenerationWithSitemapIndexExample
{
private readonly ISitemapGenerator _sitemapGenerator;
private readonly ISitemapIndexGenerator _sitemapIndexGenerator;
//--this is a bogus interface defined in this example to simulate something you might use to get a list of URls from your CMS or something like that
private readonly IWebsiteUrlRetriever _websiteUrlRetriever;
//--and IoC/Dependency injection framework should inject this in
public SitemapGenerationWithSitemapIndexExample(
ISitemapGenerator sitemapGenerator,
@ernado-x
ernado-x / sitemap-example.cs
Last active November 3, 2021 11:05
X.Web.Sitemap - simple example
class Program
{
static void Main(string[] args)
{
var sitemap = new Sitemap();
sitemap.Add(new Url
{
ChangeFrequency = ChangeFrequency.Daily,
Location = "http://www.example.com",
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
namespace Campus.Core.Social
{
public class TelegramAuthResponse
{
@ernado-x
ernado-x / youtube-clear.js
Last active November 19, 2017 10:02
Clear youtube liked videos
var items = $('body').getElementsByClassName("pl-video-edit-remove-liked-video");
for(var i = 0; i < items.length; i++){ items[i].click(); }
@ernado-x
ernado-x / download.sh
Created May 17, 2017 20:41
Download file from We Transfer
wget --user-agent Mozilla/4.0 '[your big address here]' -O dest_file_name
@ernado-x
ernado-x / Database.cs
Created September 11, 2016 16:03
Small class for making SQL calls to SQL Server from .NET Core
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
namespace Core.Data
{
/// <summary>
///
/// </summary>
@ernado-x
ernado-x / merry_christmas.sql
Last active January 12, 2016 17:12
Merry Christmas SQL script
-- Run in SQL Server Management Studio
USE tempdb
GO
-- Prepare the scene
CREATE TABLE #ChristmasScene
(
@ernado-x
ernado-x / monoserve.sh
Last active December 29, 2022 13:06 — forked from jokecamp/monoserver
Linux startup script for fastcgi-mono-server4
#!/bin/bash
### BEGIN INIT INFO
# Provides: monoserve.sh
# Required-Start: $local_fs $syslog $remote_fs
# Required-Stop: $local_fs $syslog $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start FastCGI Mono server with hosts
### END INIT INFO
@ernado-x
ernado-x / SQL Server Data Types and Their .NET Framework Equivalents
Last active January 26, 2019 01:09
SQL Server Data Types and Their .NET Framework Equivalents
SQL Server data type CLR data type (SQL Server) CLR data type (.NET Framework)
varbinary SqlBytes, SqlBinary Byte[]
binary SqlBytes, SqlBinary Byte[]
varbinary(1), binary(1) SqlBytes, SqlBinary byte, Byte[]
image None None
varchar None None
char None None
nvarchar(1), nchar(1) SqlChars, SqlString Char, String, Char[]
nvarchar SqlChars, SqlString String, Char[]