Skip to content

Instantly share code, notes, and snippets.

@farukcan
farukcan / badwordfilter.md
Created July 25, 2024 13:31
Trie Bad Word Filter

TrieNode ve Trie Sınıfları

Öncelikle, daha önce tanımladığımız TrieNode ve Trie sınıflarını kullanacağız.

class TrieNode {
    constructor() {
        this.children = {};
@farukcan
farukcan / note.md
Last active May 31, 2023 12:16
Joinler

Join

Joinler iki tabloyu birleştirip, iki tablodan aynı andan veri seçmeye(select) yarar.

Joinler hepsi aslında kartezyen çarpımı yapar. Ve iki tipi vardır. İnner, Outer.

Inner Join

Inner join iki tablonun kartezyen çarpımını alıp where operatorle birleştirir.

Ayrıca null değerleri birbine bağlayamaz, bu sebeple outer ile asıl işlevsel farkı null değerlerin olamamasıdır.

@farukcan
farukcan / Code.gs
Created May 26, 2023 08:49
App Script Chat Bot Sample
// 1) Copy or Duplicate this spreadsheet (and this AppsScript project)
//
// 2) Run "setup" function once
// - Use the menu above.
//
// 3) Create Google Cloud Service Project. And copy the Project Number.
//
// 4) This > Project Settings > Set GCM project number
//
// 5) Add the line "chat": {} to your manifest file. (IMPORTANT)
@farukcan
farukcan / sample.md
Last active May 2, 2023 15:34
Postgress net core

Program.cs

Note: i've more a gist about it.

using Microsoft.EntityFrameworkCore;
builder.Services.AddDbContext<Context>(options =>
    options.UseNpgsql(System.Environment.GetEnvironmentVariable("POSTGRESQL_STRING") ?? throw new InvalidOperationException("Connection string 'POSTGRESQL_STRING' not found."),
    options => options.EnableRetryOnFailure().SetPostgresVersion(new Version(9, 6))
));
@farukcan
farukcan / npm.json
Last active March 2, 2023 20:45
Visual Powershell - NPM Commands
{
"Name": "NPM Commands",
"Author": "farukcan",
"Website": "https://farukcan.net",
"Commands": [
{
"Name": "🚀Initialize package.json",
"Scripts": [
"npm init -y"
]
@farukcan
farukcan / chocolatey.json
Last active February 28, 2023 17:50
Visual Powershell - App Installer (Chocolatey)
{
"Name": "App Installer (Chocolatey)",
"Author": "farukcan",
"Website": "https://farukcan.net",
"Commands": [
{
"Name": "⚠️Run Visual PS as administrator",
"Scripts": [
"echo \"This command requires Adminisrator rights. Right click the Visual PS and open as administrator\""
]
@farukcan
farukcan / dotnet.json
Last active February 28, 2023 14:09
Visual Powershell .NET Core Commands
{
"Name": ".NET Core",
"Author": "farukcan",
"Website": "https://farukcan.net",
"Commands": [
{
"Name": "🆕 New Project (with Template)",
"Scripts": [
"dotnet new \"{text:Template (short-name)}\" --name \"{text:Project Name}\" {text:Extra parameters (optional)}"
]
@farukcan
farukcan / restapi.json
Created February 27, 2023 23:10
Visual Powershell - Useful Rest APIs
{
"Name": "Useful Rest APIs",
"Author": "farukcan",
"Website": "https://farukcan.net",
"Commands": [
{
"Name": "Currency Converter",
"Scripts": [
"Invoke-RestMethod \"https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/latest/currencies/{text:Currency From (3 character format,lower case)}/{text:Currency To}.json\""
]
@farukcan
farukcan / FilesAndFolders.json
Last active February 27, 2023 21:25
Visual Powershell Files and Folders
{
"Name": "Files and Folders",
"Author": "farukcan",
"Website": "https://github.com/farukcan/visualps",
"Commands": [
{
"Name": "🔍📁 List Workspace",
"Scripts": [
"ls"
]
@farukcan
farukcan / repo.json
Last active March 28, 2023 15:23
VisualPS Test Dialog Types
{
"Name": "Test & Examples",
"Author": "farukcan",
"Website": "https://farukcan.net",
"Commands": [
{
"Name": "🖹 Text Dialog",
"Scripts": [
"echo \"Your message is {text:Message}\""
]