Skip to content

Instantly share code, notes, and snippets.

View mertasan's full-sized avatar

Mert Aşan mertasan

View GitHub Profile
@mertasan
mertasan / screenshots.sh
Last active February 25, 2023 12:06
Screenshot config for macOS
#!/bin/bash
BASENAME=$HOME/Desktop
FOLDER="Screenshots"
FILENAME="screenshot"
EXT="png"
# Screenshot dizinini özelleştir
cd "$BASENAME"
mkdir -p "$FOLDER"
@mertasan
mertasan / aliases.zsh
Last active March 9, 2022 19:05
Valet - PHP Version Switcher
# PHP Versions
phpversions() {
brew list | grep -E '^php$|^php[\@|0-9|_|.]+$' | xargs echo | sed 's/ / /g';
}
# Switch - PHP Version
phpv() {
valet stop
brew unlink `phpversions`
brew link --force --overwrite $1
@mertasan
mertasan / .profile
Last active March 23, 2021 14:46
Multiple Php versions and Bash aliases for Laravel, Valet and Composer
alias php@7.4='$(brew --prefix php@7.4)/bin/php'
alias php@8='$(brew --prefix php@8.0)/bin/php'
alias php='$(brew --prefix php@8.0)/bin/php'
alias composer="php /usr/local/bin/composer"
alias composer@7.4="php@7.4 /usr/local/bin/composer"
alias composer@8="php@8 /usr/local/bin/composer"
alias artisan='php artisan'
alias artisan@8='php@8 artisan'
@mertasan
mertasan / private_fork.md
Created December 30, 2020 23:15 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

#!/usr/bin/env bash
# Usage: {script} DIRECTORY
# Find PHP's commented code and remove then.
#
# --help, -h Displays this help
#
# Report bugs to Henrique Moody <henriquemoody@gmail.com>
#
declare -r SCRIPT_NAME=$(basename ${0})
@mertasan
mertasan / gist:eaf0a55727c3503cf359108ccc15a90a
Created November 16, 2018 14:14 — 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;
@mertasan
mertasan / validate-tc-id.js
Created November 16, 2018 09:17 — forked from Eomerx/validate-tc-id.js
Validate TC ID
//=======================================
// CHECK TC ID =
//=======================================
var checkTcNum = function(value) {
value = value.toString();
var isEleven = /^[0-9]{11}$/.test(value);
var totalX = 0;
for (var i = 0; i < 10; i++) {
totalX += Number(value.substr(i, 1));
}