Skip to content

Instantly share code, notes, and snippets.

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

Ahmet Can IŞIK ahmetcanisik

🏠
Working from home
View GitHub Profile
@ahmetcanisik
ahmetcanisik / found-version.sh
Created June 11, 2025 15:09
[Get package version with one line command] Found version of python libraries with one line terminal command #python #library
python3 -c "import sys;from importlib_metadata import version;print(version(sys.argv[1]))" 'pip'
# or
python3 -c "from sys import argv;from subprocess import run;from re import findall, MULTILINE;version = run(['pip', 'show', argv[1] if argv[1] else 'pip'], check=True, capture_output=True, text=True);print(findall(r'^Version:\s*([\d\.]+)', version.stdout, MULTILINE)[0])" "pip"
# or
python3 -c "from pkg_resources import get_distribution; print(get_distribution('pip').version)"
@ahmetcanisik
ahmetcanisik / fetch.tsx
Last active April 28, 2025 18:57
[Fetch and Write data- React] Fetch datas and write to components in React
import { useEffect, useState } from "react";
interface ResponseData {
userId: number;
id: number;
title: string;
body: string;
}
function App() {
@ahmetcanisik
ahmetcanisik / js-tricks.js
Last active March 30, 2025 19:39
[js tricks] JavaScript tricks, quizes and more tips... #js #javascript #quiz #test #tricks #tips
console.log(
// quiz 1: Why is result false?
"This is a string." instanceof String, // false
// explain quiz 1
typeof "This is a string.", // "string"
typeof String, // "object"
new String("This is a string.") === String, // true
new String("This is a string.") === Object, // true
@ahmetcanisik
ahmetcanisik / basic-node-server.js
Created March 16, 2025 12:43
basic node.js server
const http = require("http");
const server = http.createServer((req, res) => {
const urlPath = req.url;
if (urlPath === "/overview") {
res.end('Welcome to the "overview page" of the nginX project');
} else if (urlPath === "/api") {
res.writeHead(200, { "Content-Type": "application/json" });
res.end(
JSON.stringify({
@ahmetcanisik
ahmetcanisik / temeller.cs
Last active November 5, 2024 18:15
[Csharp temelleri] csharp temel eğtimi #csharp
// Ekrana "Merhabalar Veyselciğim" yazan programın kodlarını c# dili ile gösteriniz?
Console.WriteLine("Merhabalar Veyselciğim"); // ekrana birşeyler bastıracaksan(yazdıracaksan) kullanılır. Ya da Write da olur.
// Ekrana "Kütüphanede çalışılıyor be" yazdıran programın kodlarını c# dili ile gösteriniz?
Console.WriteLine("kütüphanede çalışılıyor be");
// Kullanıcı(yani uygulamamızı kullanan beyefendi) bir sayı girsin ve bu sayıya 3 ekleyip tekrardan ekrana bastıran programın kodlarını c# dili ile gösteriniz?
// Console.ReadLine() ifadesi kullanıcıdan bir yazı girişi bekler. Mesela 5 girdik diyelim. Console.ReadLine() bunu "5" olarak algılar.
Console.Write("Bir sayı giriniz: ");
string kgd = Console.ReadLine();
@ahmetcanisik
ahmetcanisik / girilen-en-buyuk-sayi.cs
Created November 1, 2024 11:05
[Girilen Üç Sayıdan En Büyüğünü Bul] girilen üç sayıdan en büyük olanı bulan program örneği #charp #c$
using System;
using System.Security.Cryptography.X509Certificates;
namespace ConsoleApp1
{
internal class Program
{
static void Main(string[] args)
{
int eb = 0;
@ahmetcanisik
ahmetcanisik / yas_hesapla.cs
Created October 19, 2024 20:05
Alınan doğum yılı bilgisine göre kullanıcının yaşını hesaplayan programın kodları
using System;
public class Algoritma
{
private static string input(string message = "") {
Console.Write(message);
return Console.ReadLine();
}
public static void Main(string[] args)
@ahmetcanisik
ahmetcanisik / iki_defa_yazdir.cs
Created October 19, 2024 20:01
Kullanıcıdan alınan değeri iki defa ekrana yazdıran programın kodları
using System;
public class Algoritma
{
private static string input(string message = "") {
Console.Write(message);
return Console.ReadLine();
}
public static void Main(string[] args)
@ahmetcanisik
ahmetcanisik / iki_sayinin_toplami.cs
Last active October 19, 2024 19:07
Kullanıcıdan alınan iki sayıyı toplayan programın kodları C#
using System;
public class Matematik
{
public static string input(string message)
{
Console.Write(message);
return Console.ReadLine();
}