Skip to content

Instantly share code, notes, and snippets.

View ekaraman89's full-sized avatar
:octocat:
Working from home

Emrah Karaman ekaraman89

:octocat:
Working from home
View GitHub Profile
@ekaraman89
ekaraman89 / random.sql
Last active July 18, 2019 16:55
t-sql random string
String > SUBSTRING(CONVERT(varchar(40), NEWID()),0,9)
0 - 1 > convert(bit, round(1*rand(),0))
5 - 40 > Cast(RAND()*(40-5)+5 as int)
USE [OnlineEducation]
GO
SET IDENTITY_INSERT [dbo].[Lesson] ON
GO
INSERT [dbo].[Lesson] ([ID], [Name], [Mission]) VALUES (1, N'Ders 1', N'Ders 1 amaç')
GO
INSERT [dbo].[Lesson] ([ID], [Name], [Mission]) VALUES (2, N'Ders 2', N'Ders 2 amaç')
GO
INSERT [dbo].[Lesson] ([ID], [Name], [Mission]) VALUES (3, N'Ders 3', N'Ders 3 amaç')
GO
bin,banka_kodu,banka_adi,type,sub_type,virtual,prepaid
413226,10,T.C. ZİRAAT BANKASI A.Ş.,VISA,PLATINUM
444676,10,T.C. ZİRAAT BANKASI A.Ş.,VISA,CLASSIC
444677,10,T.C. ZİRAAT BANKASI A.Ş.,VISA,GOLD
444678,10,T.C. ZİRAAT BANKASI A.Ş.,VISA,PLATINUM
453955,10,T.C. ZİRAAT BANKASI A.Ş.,VISA, CLASSIC
453956,10,T.C. ZİRAAT BANKASI A.Ş.,VISA, GOLD
454671,10,T.C. ZİRAAT BANKASI A.Ş.,VISA, CLASSIC
454672,10,T.C. ZİRAAT BANKASI A.Ş.,VISA, CLASSIC
454673,10,T.C. ZİRAAT BANKASI A.Ş.,VISA, BUSINESS
// Install-Package iTextSharp -Version 5.5.10
using iTextSharp.text;
using iTextSharp.text.pdf;
using iTextSharp.text.html.simpleparser;
private void printHtmlToPdf(string html)
{
using System.Net;
public class GoogleCaptha
{
function onlyUnique(value, index, self) {
return self.indexOf(value) === index;
}
// usage example:
var a = ['a', 1, 'a', 2, '1'];
var unique = a.filter( onlyUnique ); // returns ['a', 1, 2, '1']
@ekaraman89
ekaraman89 / result.json
Created April 15, 2020 14:10 — forked from MuhammetDilmac/result.json
Türkiye Şehirler ve İlçeleri
[
{
"name": "Adana",
"districts": [
{
"name": "Aladağ"
},
{
"name": "Ceyhan"
},
[HttpGet(Name = "GetWeatherForecast")]
public IActionResult Get()
{
try
{
IEnumerable<WeatherForecast> list = Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateTime.Now.AddDays(index),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
using System.Net;
using System.Text.Json;
namespace GlobalExceptionHandling.Middleware
{
public class GlobalExceptionHandlingMiddleware
{
private readonly RequestDelegate _next;
public GlobalExceptionHandlingMiddleware(RequestDelegate next)
namespace GlobalExceptionHandling.Middleware
{
public class ResponseModel
{
public int responseCode { get; set; }
public string? responseMessage { get; set; }
}
}