Skip to content

Instantly share code, notes, and snippets.

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

muhammed burak şentürk meftunca

🏠
Working from home
  • A developer who suffers from the disease of selectivity in learning from unnecessary real-life experience.
  • İstanbul
  • 00:26 (UTC +03:00)
View GitHub Profile
#include <cstdint>
#include <iostream>
#if defined(__linux__)
#include <sys/resource.h>
#elif defined(__APPLE__) && defined(__MACH__)
#include <mach/mach.h>
#elif defined(_WIN32)
#include <windows.h>
#include <psapi.h>
@meftunca
meftunca / css-properties.json
Created April 5, 2023 11:35 — forked from cblanquera/css-properties.json
CSS properties via JSON
{
"align-content": {
"moz": false,
"webkit": true,
"syntax": "(stretch)|(center)|(flex-start)|(flex-end)|(space-between)|(space-around)|(initial)|(inherit)",
"initial": "stretch",
"values": [
"stretch",
"center",
"flex-start",
@meftunca
meftunca / gitbackup.sh
Created April 3, 2023 10:07
Automated script to create a new branch with the date and push changes for all projects with a .git folder in a specified directory.
#!/bin/bash
# Belirlenen dizin
DIRECTORY="/path/to/directory"
# Bugünün tarihi
DATE=$(date +"%Y%m%d")
# Tüm .git klasörlerinin listesi
GIT_DIRS=$(find "$DIRECTORY" -type d -name ".git")
@meftunca
meftunca / performanceLogger.hpp
Created November 21, 2022 00:54
C++ Performance Logger like browser console.time/End
#include <chrono>
#include <map>
struct PerformanceTracker {
std::chrono::steady_clock::time_point start;
std::chrono::steady_clock::time_point end;
};
class PerformanceLogger {
public:
@meftunca
meftunca / fix_ios_15_simulator_spotlight_cpu.sh
Created October 31, 2022 14:04 — forked from dive/fix_ios_15_simulator_spotlight_cpu.sh
Fix the iOS 15 Simulator high CPU usage due to the Spotlight/Suggestions Engine
#!/bin/env sh
disable_suggestions() {
if [ -d "$1" ]; then
pushd "$1" || return
find . -name com.apple.suggestions.plist \
-exec echo {} \; \
-exec plutil -replace SuggestionsAppLibraryEnabled -bool NO {} \;
popd || return
fi
@meftunca
meftunca / regex101.ts
Last active September 25, 2020 14:22
Yardımcı regex ifadeleri
// Yorum blokları ve satır yorumlarını almak için ifade
// örnek1 :
// /**
// Bu bir blok yorumdur
// */
// Örnek2 :
// Bu bir satır yorumdur
type User struct {
ID int64 `gorm:"primary_key;auto_increment" json:"id"`
NickName string `gorm:"size:255;not null;unique" db:"nick_name" json:"nickName"`
Avatar string `gorm:"size:255;unique" db:"avatar" json:"avatar"`
Name string `gorm:"size:255;not null" json:"name"`
LastName string `gorm:"size:255;not null" db:"last_name" json:"lastName"`
Phone string `gorm:"size:16;not null;unique" json:"phone"`
RememberToken string `gorm:"size:255;not null" db:"remember_token" json:"rememberToken"`
Email string `gorm:"size:100;not null;unique" json:"email"`
Password string `gorm:"size:100;not null;" json:"password"`
@meftunca
meftunca / snackbar.js
Created March 19, 2020 12:16
React native paper snackbar (without context api)
import React, {useEffect, useState} from 'react';
import {Snackbar} from 'react-native-paper';
const GlobalSnackbar = () => {
const [state, setBaseState] = useState({
visible: false,
action: null,
message: '',
duration: 3000,
style: null,
const uploadFile = files => {
const headers = new Headers();
// headers.append('Accept', 'application/json');
headers.append('Content-Type', 'multipart/form-data');
headers.append(
'Authorization',
'XPHBO4yPFDeXv-1FfqBIiOGwtvkSFH71Nmi-Hye0QQQ=',
);
let uploadFunctions = async file => {
let {uri, type: mimeType, fileName} = file;
@meftunca
meftunca / clearProjectBuildFolders.sh
Created January 7, 2020 21:13
Mac veya linux için npm ve react native(android, ios) proje sonrası gereksiz dosyaları(node_modules,**/build, Pods) temizleme kodu
find . -name "node_modules" -type d -prune -exec rm -rf '{}' + && find . -name "Pods" -type d -prune -exec rm -rf '{}' + && find . -name "build" -type d -prune -exec rm -rf '{}' +