Skip to content

Instantly share code, notes, and snippets.

services:
directus:
image: directus/directus:11.3.5
ports:
- 8055:8055
volumes:
- ./database:/directus/database
- ./uploads:/directus/uploads
- ./extensions:/directus/extensions
environment:
@yavuz
yavuz / wordpress_remove_wp.sh
Created January 25, 2023 22:03
Remove Wordpress with works Valet in Local
#!/bin/sh
DBUSER="root"
DBPASS="1"
# move to trash
mv ~/Sites/$1 ~/.Trash
# create database
echo "drop database wp_"$1 | mysql -u $DBUSER -p$DBPASS
git remote add origin https://github.com/yavuz/myrepo.git
git remote set-url origin https://github.com/yavuz/myrepo.git
@yavuz
yavuz / wordpress_install_wp.bash
Last active September 14, 2022 12:18
Create Wordpress with works Valet in Local
#!/bin/sh
DBUSER="root"
DBPASS="1"
# create directory
mkdir -p ~/Sites/$1
# goto websites directory
cd ~/Sites/$1
@yavuz
yavuz / deep_learning.py
Last active February 5, 2019 16:48
simple keras project template - model export and load template
# Create first network with Keras
from keras.models import Sequential
from keras.layers import Dense
import numpy
# load pima indians dataset
# dataset = numpy.loadtxt("pima-indians-diabetes.csv", delimiter=",")
dataset = numpy.loadtxt("output.csv", delimiter=",")
# split into input (X) and output (Y) variables
X = dataset[:,0:6]
@yavuz
yavuz / purge_idle_connections
Created January 28, 2019 08:26
purge idle connections for mysql event
begin
declare done boolean default false;
declare max_time int default coalesce(@max_kill_time, 240);
declare pid bigint;
declare c cursor for
SELECT id
FROM information_schema.processlist
WHERE command in ('Sleep')
AND time > max_time;
declare continue handler for not found
@yavuz
yavuz / keybase.md
Last active February 3, 2018 23:41

Keybase proof

I hereby claim:

  • I am yavuz on github.
  • I am yavuz (https://keybase.io/yavuz) on keybase.
  • I have a public key ASBPb1-RrcsuaHASGvHu9sb5sdWyBk70Xk9IDb1OTuFLZwo

To claim this, I am signing this object:

@yavuz
yavuz / strtoupper.php
Created December 12, 2016 11:26
strtolower_tr strtoupper_tr
<?php
static function strtoupper_tr($s){
$tmp = str_replace(
array("a","b","c","ç","d","e","f","g","ğ","h","ı",
"i","j","k","l","m","n","o","ö","p","r","s","ş","t",
"u","ü","v","y","z","q","w","x"),
array("A","B","C","Ç","D","E","F","G","Ğ","H","I",
"İ","J","K","L","M","N","O","Ö","P","R","S","Ş","T",
"U","Ü","V","Y","Z","Q","W","X"),
$s
@yavuz
yavuz / ReplaceTurkishCharacter.js
Created February 5, 2016 21:43
Replace Turkish Character
// http://character-code.com/turkish-html-codes.php
replaceAll = (find, replace, str) => {
return str.replace(new RegExp(find, 'g'), replace);
}
function ReplaceTurkishCharacter(str) {
str = replaceAll('&#304;','İ',str);
str = replaceAll('&#305;','ı',str);
str = replaceAll('&#214;','Ö',str);
str = replaceAll('&#246;','ö',str);
@yavuz
yavuz / audio play swift
Last active June 17, 2016 22:53
audio play
import Foundation
import AudioToolbox
class AppSound {
var audioEffect : SystemSoundID = 0
init(name : String, type: String) {
let path = NSBundle.mainBundle().pathForResource(name, ofType: type)!
let pathURL = NSURL(fileURLWithPath: path)
AudioServicesCreateSystemSoundID(pathURL, &audioEffect)