Skip to content

Instantly share code, notes, and snippets.

View erkantaylan's full-sized avatar
🫖
I'm a teapot

erkan erkantaylan

🫖
I'm a teapot
  • TURKEY
  • 08:08 (UTC +03:00)
View GitHub Profile
@erkantaylan
erkantaylan / slack-theme-backup
Created April 3, 2018 13:20
Slack Custom Theme Color Backup
#5F0A87,#910FCE,#139eDA,#FFFFFF,#910FCE,#FFFFFF,#0A8720,#FF0000
@erkantaylan
erkantaylan / stylish-whatsapp.css
Last active February 16, 2018 06:36
Dark WhatsApp Theme by Mew Edited
/*
Theme : Dark WhatsApp Theme by Mew
Version: 1.1.0
Author : vednoc
Website: github.com/vednoc/rice
Discord: https://discord.gg/sNywty5
*/
:root {
--dark: #272C35;
--darker: #1F232A;
@erkantaylan
erkantaylan / autosave.cs
Created January 31, 2018 08:47
Visual Studio Auto Save via VCMD
public class E : VisualCommanderExt.IExtension
{
public void SetSite(EnvDTE80.DTE2 DTE_, Microsoft.VisualStudio.Shell.Package package)
{
DTE = DTE_;
System.Windows.Application.Current.Deactivated += OnDeactivated;
}
public void Close()
{
@erkantaylan
erkantaylan / JsonExtensions.cs
Created January 8, 2018 11:10
Newtonsoft json extensions
using Newtonsoft.Json;
internal static class JsonExtensions {
public static string ObjectToJson<T>(this T that) {
return JsonConvert.SerializeObject(that);
}
public static T JsonToObject<T>(this string that) {
return JsonConvert.DeserializeObject<T>(that);
}
public partial class App : Application
{
void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
MessageBox.Show(e.Exception.ToString());
}
}
@erkantaylan
erkantaylan / Zip.cs
Created December 1, 2017 10:46
ZipStorer helper
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
namespace Medicine.BusinessLayerLogic.Squeezing {
public sealed class Zip {
public void Extract(string zipPath, string extractPath) {
if (IsFileLocked(new FileInfo(zipPath))) {
throw new FileInUseException();
@erkantaylan
erkantaylan / FingerPrint.cs
Created December 1, 2017 10:38
Fingerprint
/*
.-.
|U|
_.-._| |
| | | | |
/| ` |
| | |
| |
\ /
| |
@erkantaylan
erkantaylan / Costura.Fody.csproj
Created November 29, 2017 12:38
Costura.Fody Remove dll's after build, add this line to`.csproj` file in`Target` tag
<Delete Files="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')" />
@erkantaylan
erkantaylan / EventAggregator.cs
Last active May 4, 2025 15:07
C# Event Aggregator Classes (This code does not belong to me, I don't remember where/when I got)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
public class EventAggregator : IEventAggregator {
private readonly Dictionary<Type, List<WeakReference>> eventSubscribers = new Dictionary<Type, List<WeakReference>>();
private readonly object lockSubscriberDictionary = new object();
private void InvokeSubscriberEvent<TEventType>(TEventType eventToPublish, ISubscriber<TEventType> subscriber) {
@erkantaylan
erkantaylan / AccessDbConnection.cs
Last active October 26, 2017 19:05
Access Database Connection Sample
internal class DbConnection {
private readonly string cnnStr; //= "Data Source=localhost;Initial Catalog=bilmuh;Integrated Security=True";
private OleDbCommand sqlCmd; //Sql Komutu
private OleDbConnection sqlCnn; //Bağlantı
private OleDbDataAdapter sqlDa;
public DbConnection(string cnnStrGonderilen) //Eğer bağlantı stringi farklılık gösterirse
{
cnnStr = cnnStrGonderilen;
}