Skip to content

Instantly share code, notes, and snippets.

View mzuvin's full-sized avatar
🎯
Focusing

Mustafa Zuvin mzuvin

🎯
Focusing
View GitHub Profile
@mzuvin
mzuvin / MilyonerSoru.cs
Last active September 10, 2023 18:53
Türkiye'deki 81 ilin adında bu dört harften hangisi diğer üçünden daha az bulunur? Kim Milyoner Olmak İster'de 1 milyonluk sorunun cevabı
//Türkiye'deki 81 ilin adında bu dört harften hangisi diğer üçünden daha az bulunur? A:Ş B:V C:G D:H
var list=new List<string>{"A","D","A","N","A","A","D","I","Y","A","M","A","N","A","F","Y","O","N","K","A","R","A","H","İ","S","A","R","A","Ğ","R","I","A","M","A","S","Y","A","A","N","K","A","R","A","A","N","T","A","L","Y","A","A","R","T","V","İ","N","A","Y","D","I","N","B","A","L","I","K","E","S","İ","R","B","İ","L","E","C","İ","K","K","B","İ","N","G","Ö","L","B","İ","T","L","İ","S","B","O","L","U","B","U","R","D","U","R","B","U","R","S","A","Ç","A","N","A","K","K","A","L","E","Ç","A","N","K","I","R","I","Ç","O","R","U","M","D","E","N","İ","Z","L","İ","D","İ","Y","A","R","B","A","K","I","R","E","D","İ","R","N","E","E","L","A","Z","I","Ğ","E","R","Z","İ","N","C","A","N","E","R","Z","U","R","U","M","E","S","K","İ","Ş","E","H","İ","R","G","A","Z","İ","A","N","T","E","P","G","İ","R","E","S","U","N","G","Ü","M","Ü","Ş","H","A","N","E","H","A","K","K","A","R","İ","H","A","T","A","Y","I","S","P","A","R","T","A","M",
```sql
SELECT
substr(hguid, 7, 2) || substr(hguid, 5, 2)
|| substr(hguid, 3, 2) || substr(hguid, 1, 2) || '-'
|| substr(hguid, 11, 2) || substr(hguid, 9, 2) || '-'
|| substr(hguid, 15, 2) || substr(hguid, 13, 2) || '-'
|| substr(hguid, 17, 4) || '-'
|| substr(hguid, 21, 12)
AS guid
@mzuvin
mzuvin / imageDownloadThenUpload.js
Created December 3, 2021 19:49
imageDownloadThenUpload.js
var imgs=[
"https://image.com/image1.jpg",
"https://image.com/image2.jpg",
]
imgs.forEach(url=>imgUpload(url))
function imgUpload(url) {
fetch(url).then(function(response) {
console.log("image download");
@mzuvin
mzuvin / Program.cs
Created March 20, 2021 10:25
ChangeTracker
//https://stackoverflow.com/a/65642075/9218468
using System;
using System.Collections.Generic;
using System.Linq;
namespace ChangeTracker
{
public class ChangeTracker<T1, T2>
{
private readonly IEnumerable<T1> oldValues;
@mzuvin
mzuvin / addHours.js
Created May 7, 2020 15:07
javascript addHours list range
Date.prototype.addHours = function(h) {
this.setTime(this.getTime() + (h * 60 * 60 * 1000));
return this;
}
var startDate = new Date('Sun Apr 19 2020 07:00:00 GMT+0300 (GMT+03:00)');
var finishDate = new Date('Sun Apr 19 2020 10:00:00 GMT+0300 (GMT+03:00)');
checkedList = []
while (startDate < finishDate) {

CREATE KEYSPACE streamkeyspace WITH replication = {'class':'SimpleStrategy', 'replication_factor' : 3};

CREATE TABLE IF NOT EXISTS streamkeyspace.user ( 
  id uuid PRIMARY KEY, 
  created_time timestamp, 
  username text, 
  password text, 
 email text
@mzuvin
mzuvin / ajaxPreFilter.js
Created December 29, 2019 18:44
FREERİCE TRANSLATE Js BOOKMARKLET
/*
Coder by Mustafa
29.12.19 21:30
Ajax Mudehale ile FreeRice sitesinde çeviri işlemi
*/
// thanks https://gist.github.com/liron-navon/eff96016a233f102fe43030c3a16f4a5
const APIKEY = 'trnsl.1.1.20191229T171159Z.1c8e8e7908ec7585.bedb9463e1aa12faa0798882dc1742e44dc0ad53';
const FROM = 'en';
// default source language
const TO = 'tr';
str="mustafa"
str2=[]
// 0.adım string dizisini sayısal değerlere çevir.
for (var i=0; i<str.length;i++){
str2.push(str[i].charCodeAt(0))
}
//1. adım: dizideki i. sırasından sonraki en küçük sayının yerini bul.
function selectionSort(num) {