Skip to content

Instantly share code, notes, and snippets.

View anilkay's full-sized avatar
🏠
Working from home

Anıl Kaynar anilkay

🏠
Working from home
View GitHub Profile
//Nice Url Builder for Dotnet.
using Flurl;
using System.Text;
string GetWeatherOfCityUrl(string cityName){
var weather = "https://wttr.in"
.AppendPathSegment(cityName)
.SetQueryParams(new
{
@anilkay
anilkay / splide_example.html
Created October 2, 2022 21:46
example of splide.js
<html>
<head>
<title>Splida.js Examples</title>
<!--https://splidejs.com-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@splidejs/splide@4.1.3/dist/css/splide.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@splidejs/splide@4.1.3/dist/css/themes/splide-skyblue.min.css">
<script src="https://cdn.jsdelivr.net/npm/@splidejs/splide@4.1.3/dist/js/splide.min.js"></script>
</head>
<body>
<h1>Hello World</h1>
public class Speed(){
public void Main(){
Example example=new Example();
example.SpeedValueChanged += delegate (int speed)
{
Console.WriteLine("Speed changed: " + speed);
};
example.SpeedValueChanged += (int speed)=>
<!DOCTYPE html>
<html>
<head>
<title> Deneme</title>
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
</head>
<body>
<h1>Evet</h1>
<div id="main_img"></div>
// See https://aka.ms/new-console-template for more information
int ?nullable = null;
//var a = (int)(nullable + nullable); NUllable object must have a value
nullable = 44;
var a = (int)(nullable + nullable); //Work fine but it's error prone.
async static Task SpeechSynthesis3(SpeechConfig speechConfig)
{
speechConfig.SpeechSynthesisLanguage = "tr-TR";
//speechConfig.SpeechSynthesisVoiceName = "tr-TR-EmelNeural";
var audioConfig=AudioConfig.FromWavFileOutput("uretilen.wav");
using var synthesizer = new SpeechSynthesizer(speechConfig,audioConfig);
while (true)
{
string speech = Console.ReadLine();
if (speech.ToLower().Contains("sentezi kapat")) break;
async static Task SpeechSynthesis(SpeechConfig speechConfig)
{
speechConfig.SpeechSynthesisLanguage = "tr-TR";
speechConfig.SpeechSynthesisVoiceName = "tr-TR-EmelNeural";
using var synthesizer = new SpeechSynthesizer(speechConfig);
while (true)
{
string speech = Console.ReadLine();
if (speech.ToLower().Contains("sentezi kapat")) break;
await synthesizer.SpeakTextAsync(speech);
using Microsoft.CognitiveServices.Speech;
using Microsoft.CognitiveServices.Speech.Audio;
using NAudio.CoreAudioApi;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
class Program
{
public string PasswordCleaning(string pass)
{
pass=pass.Replace("+", "%2b");
pass = pass.Replace("&", "%26");
pass= pass.Replace("=", "%3D");
pass = pass.Replace("?", "%3F");
pass = pass.Replace(":", "%3A");
pass = pass.Replace(";", "%3B");
pass = pass.Replace("$", "%24");
pass = pass.Replace("@", "%40");
def shiftcipher_decryptor(cipher_text,shift_amount=3):
return shiftcipher_encryptor(cipher_text,-shift_amount)
def shiftcipher_encryptor(plain_text,shift_amount=3):
shifted=[]
for p in plain_text:
shifted_chr=chr(ord(p)+shift_amount)
shifted.append(shifted_chr)
return "".join(shifted)