Skip to content

Instantly share code, notes, and snippets.

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

Ferdi ÜNAL ferdiunal

🏠
Working from home
View GitHub Profile
@ferdiunal
ferdiunal / useUndo.ts
Created February 17, 2024 15:26 — forked from KristofferEriksson/useUndo.ts
A React hook that enhances your components with powerful undo/redo functionality
import { useCallback, useEffect, useRef, useState } from "react";
interface UseUndoHook<T> {
value: T;
onChange: (newValue: T) => void;
undo: () => void;
redo: () => void;
clear: () => void;
canUndo: boolean;
canRedo: boolean;
@ferdiunal
ferdiunal / upload.component.ts
Created May 14, 2021 08:17 — forked from kkbalu/upload.component.ts
Vimeo video uploader using tus js client
//Filename: upload.component.ts
import { Component, OnInit } from '@angular/core';
import { UploadService } from '../upload.service';
import { map, expand } from 'rxjs/operators';
import { EMPTY } from 'rxjs';
export class uploadFiles {
constructor(public video: File, public path: string, public uploadURI: string) {
this.video = video;
this.path = path;
{
"compilerOptions": {
"baseUrl": "src",
"paths": {
"~/*": [
"*"
]
},
"allowJs": true,
"allowSyntheticDefaultImports": true,
@ferdiunal
ferdiunal / !NOTE.md
Created April 7, 2020 10:05 — forked from mehranhadidi/!NOTE.md
Setup a Laravel Storage driver with Google Drive API
@ferdiunal
ferdiunal / sse.go
Created September 5, 2019 20:16 — forked from ismasan/sse.go
Example SSE server in Golang
// Copyright (c) 2017 Ismael Celis
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
@ferdiunal
ferdiunal / Vps Kurulumu
Created October 25, 2018 13:07 — forked from bulentsakarya/Vps Kurulumu
Ubuntu + Apache + MySQL + Php + Let's Encrypt + Mod Pagespeed + WordPress
sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoclean
sudo apt-get autoremove
adduser sakarya
usermod -aG sudo sakarya
ufw app list
ufw allow OpenSSH
// inside boot()
resolve(EngineManager::class)->extend('elasticsearch', function () {
return new ElasticsearchEngine(ClientBuilder::fromConfig(config('scout.elasticsearch.config')), config('scout.elasticsearch.index'));
});
@ferdiunal
ferdiunal / tax_validation.php
Last active August 4, 2021 12:21 — forked from emir/tax_validation.php
PHP Vergi Numarası Doğrulama
<?php
/**
* This method logically validates Turkish VAT number
*
* @param string $taxNumber
* @return bool
*/
public function validateTaxNumber(string $taxNumber): bool
{
@ferdiunal
ferdiunal / gist:c062ee333d0bbcea65152b563ecbc479
Created July 28, 2017 08:34 — forked from ziyahan/gist:3938729
Vergi Kimlik No Doğrulama Algoritması
function vergikimlik(kno) {
var v1 = 0;
var v2 = 0;
var v3 = 0;
var v4 = 0;
var v5 = 0;
var v6 = 0;
var v7 = 0;
var v8 = 0;
var v9 = 0;