Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Ferdi ÜNAL ferdiunal

🏠
Working from home
View GitHub Profile
@ferdiunal
ferdiunal / upload.component.ts
Created May 14, 2021 — forked from kkbalu/upload.component.ts
Vimeo video uploader using tus js client
View upload.component.ts
//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;
View tsconfig.json
{
"compilerOptions": {
"baseUrl": "src",
"paths": {
"~/*": [
"*"
]
},
"allowJs": true,
"allowSyntheticDefaultImports": true,
@ferdiunal
ferdiunal / !NOTE.md
Created Apr 7, 2020 — forked from mehranhadidi/!NOTE.md
Setup a Laravel Storage driver with Google Drive API
View !NOTE.md
@ferdiunal
ferdiunal / sse.go
Created Sep 5, 2019 — forked from ismasan/sse.go
Example SSE server in Golang
View sse.go
// 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
View .private
-----BEGIN RSA PRIVATE KEY-----
MIIJJgIBAAKCAgBoe2f+iDWW+xMsnKeL31ZRxPw0Gvj8Eku8MTWkFwISRF7vwepx
JWHGs2Ud/v7BZwh+aPlhp32n5JI431/XW/BFcGk3bS3tYkUBEP+cpwWJe9UDaQwN
wF3eg4WWb6BEPerOiWKUxcjz4MKG7Bw6erx4VxjxBGDBXOELZnP9G3LrnMujKoTC
Rig3Ffug3Pclr5bu04wtZ83sGZT2KX1qszwBX9kT0dOd3tAk4HmU0Kq95lc30pNA
zvJ01SfMlaolQ0YCkK1Bqe3d9HqNnv0zNILtJzNGZKJSos4iJPv+nAdwEQXVZWNt
wwdhnHLDwhMo9WKqnONTou8xKisIZfnkznb1bTAEZh/axAsVVertKQ+HryDtM+xC
PWpj4OUz0nctcb2CvAYdz+Q+csr4Fsku/8tPELJBX4Z42D1j34zWJa8CZZHIds79
luHHZdOOoLubLWs2tyKJPTirDPOPspp8uESDTDOIjtH9uIYPD8SgSWeVeBiikelM
VFKYbOmnT1ACYAwpyKOEnxN5BHtIiz6MPxAwIWLJdEduHqm5nAJYBDWgkdepWzMb
View d.php
try {
$operationLogCount = OperationLog::where('action', self::YEMEK_SEPETI_DISPATCH_TYPE)
->where('type', self::YEMEK_SEPETI_DISPATCH_TYPE)
->where('status', 1)
->where('order_id', $order->id)
->count();
if (count($radiusList) > $operationLogCount) {
$radius = $radiusList[$operationLogCount];
$order->radius = $radius;
@ferdiunal
ferdiunal / Vps Kurulumu
Created Oct 25, 2018 — forked from bulentsakarya/Vps Kurulumu
Ubuntu + Apache + MySQL + Php + Let's Encrypt + Mod Pagespeed + WordPress
View Vps Kurulumu
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
@ferdiunal
ferdiunal / helpers.py
Created Jul 6, 2018
Bir işlemi belirli bir sayıda tekrar deneyin.
View helpers.py
"""
Retry an operation a given number of times.
Bir işlemi belirli bir sayıda tekrar deneyin.
"""
def retry(times, callback):
try:
if not times:
return
return callback()
except:
View AppServiceProvider.php
// 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 Aug 4, 2021 — forked from emir/tax_validation.php
PHP Vergi Numarası Doğrulama
View tax_validation.php
<?php
/**
* This method logically validates Turkish VAT number
*
* @param string $taxNumber
* @return bool
*/
public function validateTaxNumber(string $taxNumber): bool
{