Skip to content

Instantly share code, notes, and snippets.

View fatihyildizhan's full-sized avatar
🎯
Focusing

Fatih YILDIZHAN fatihyildizhan

🎯
Focusing
View GitHub Profile
@fatihyildizhan
fatihyildizhan / traefikv2-gzip-compression.txt
Last active October 4, 2023 13:51
Traefik v2 - How to enable gzip compression
### Traefik v2 docker-compose.yml
version: '3.7'
services:
traefik:
image: traefik:v2.2.7
container_name: traefik
labels:
@fatihyildizhan
fatihyildizhan / swift-lower-or-uppercase.swift
Created April 28, 2020 12:15
Force to lower or uppercase on Swift
func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool {
if textField.isEqual(textFieldBodrum) {
textFieldBodrum.text = (textField.text as NSString).stringByReplacingCharactersInRange(range, withString: string.lowercaseString)
return false
} else if textField.isEqual(textFieldYalikavak) {
textFieldYalikavak.text = (textField.text as NSString).stringByReplacingCharactersInRange(range, withString: string.uppercaseString)
return false
}
return true
}
@fatihyildizhan
fatihyildizhan / github-domain-verification.txt
Created March 20, 2020 11:29
GitHub Domain Verification Steps
1. go to your organization settings
2. set the url under profile then click update
3. go to verified domain section and click Add a domain
4. enter the same url
5. GitHub shows you this message:
Add a DNS TXT record
Create a TXT record in your DNS configuration for _github-challenge-YOURORGANIZATIONNAME.YOURDOMAIN.
Use this code as the value for the TXT record:
YOUR VERIFICATION CODE
@fatihyildizhan
fatihyildizhan / npm i expo-cli --global.txt
Last active April 8, 2020 02:11
Install expo-cli global
I used these to install it:
bash you need to change the default terminal as bash first.
-> https://conemu.github.io/
maybe the new windows terminal does support bash too
-> https://github.com/microsoft/terminal/releases
Install Nodejs: (I don't need a higher version and it can give errors.)
-> v12.9.0
@fatihyildizhan
fatihyildizhan / blockchain.py
Created December 21, 2019 14:17
Create a simple Blockchain with python
import json
import hashlib
import datetime
from flask import Flask, jsonify, request
import requests
from uuid import uuid4
from urllib.parse import urlparse
# Part 1 - Building a Blockchain
while($true)
{
Sleep 20
$wshell = New-Object -ComObject wscript.shell;
$wshell.AppActivate('C:\WINDOWS\system32\cmd.exe')
Sleep 1
$wshell.SendKeys('s')
$promptStringStart = (Get-Date).ToLongDateString() +" - "+ (Get-Date).ToLongTimeString() + " running... "
Write-Host $promptStringStart -NoNewLine -ForegroundColor Green
@fatihyildizhan
fatihyildizhan / Upgrade Older Expo Versions to 33+ with yarn or npm.txt
Created December 19, 2019 10:01
Upgrade Older Expo Versions to 33+ with yarn or npm
1- app.json > change sdk version to "sdkVersion": "33.0.0"
2- package.json > change these to
"expo": "^33.0.0"
"react": "16.8.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz"
3- delete node_modules folder
4- yarn cache clean
5- npm install node-pre-gyp ** if you are on Windows
@fatihyildizhan
fatihyildizhan / Docker 23 + Traefik 2.9.10 and v1.7 + Let's Encrypt + Github Registry V2 ghcr.io + Updated on 12 April 2023
Last active October 22, 2023 11:58
Docker 23 + Traefik 2.9.10 and v1.7 + Let's Encrypt + Github Registry V2 ghcr.io + Updated on 12 April 2023
Docker 23 + Traefik v2.9.10 and v1.7 + Let's Encrypt + Github Registry V2 ghcr.io + Updated on 12 April 2023
Content:
- Ubuntu 22.04
- Docker Engine 23.0.3
- Docker Compose 2.17.2
- Traefik v1.7.18 with dnsChallenge
- Traefik v2.9.9 with httpChallenge
--
- Github Registry V2 ghcr.io
import Foundation
import AVFoundation
final class MediaPlayer {
static var player = AVAudioPlayer()
class func play() {
do {
let file = Bundle.main.url(forResource: "file_name", withExtension: "mp3")!
player = try AVAudioPlayer(contentsOf: file)