This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace klass\a; | |
class UserRegistrationJob implements \JsonSerializable | |
{ | |
private $name; | |
private $surname; | |
public function __construct($name,$surname) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 3. satırı baştan sona kopyalamanız gerekmektedir. Çalışır örneğini 5. satırdaki linkten görebilirsiniz. | |
/(^[0\s]?[\s]?)([(]?)([5])([0-9]{2})([)]?)([\s]?)([0-9]{3})([\s]?)([0-9]{2})([\s]?)([0-9]{2})$/g | |
// https://regexr.com/5005l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Convert a multi-dimensional array into a single-dimensional array. | |
* @author Sean Cannon, LitmusBox.com | [email protected] | |
* @param array $array The multi-dimensional array. | |
* @return array | |
*/ | |
function array_flatten($array) { | |
if (!is_array($array)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#http://stackoverflow.com/a/6457473/127508 | |
git checkout 56e05fced -- . | |
git add . | |
git commit -m 'Revert to 56e05fced' | |
And to prove that it worked: | |
git diff 56e05fced |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Export database in gzip form | |
mysqldump -u user -p database | gzip > database.sql.gz | |
// Import database from gzip form | |
gunzip < database.sql.gz | mysql -u user -p database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Trendyol'da yaptığınız toplam harcamayı hesaplar. | |
// https://www.trendyol.com/hesabim/siparislerim sayfasına gidin. | |
// Tüm siparişleri listeleyin. | |
// Console'da function'ı çağırın. => calculateTotalPrice(); | |
function calculateTotalPrice() { | |
let totalPrice = 0; | |
let prices = document.querySelectorAll('#orders-container .order .order-header .order-header-info:nth-child(4) b').forEach(function(item, index) { | |
totalPrice += parseFloat(item.innerText.replace(',', '.')); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function clearAllValues(data, byTypeOf = false) { | |
let clearValuesTypeOf = { | |
boolean: false, | |
number: 0, | |
string: '', | |
} | |
// clear array if data is array | |
if (Array.isArray(data)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function roundNumber(num, precision = 0) { | |
let decimalPlace = Math.pow(10, precision); | |
return Math.round((num + Number.EPSILON) * decimalPlace) / decimalPlace; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// function | |
function getYoutubeUrlId (url) { | |
const urlObject = new URL(url); | |
let urlOrigin = urlObject.origin; | |
let urlPath = urlObject.pathname; | |
// Örneğin url https://youtu.be/V-uynt7UXXI ise | |
if (urlOrigin.search('youtu.be') > -1) { | |
// substr yapma sebebimiz, youtube kısaltma linklerinde id path'de olur ve pathname başında "/" olur. | |
// Örneğin "/V-uynt7UXXI" ise "V-uynt7UXXI" return eder. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($request_uri ~ "^(\/)index\.php$") { | |
return 302 $1; | |
} | |
if ($request_uri ~ "^(\/)index\.php\?(.*)") { | |
return 302 $1?$2; | |
} | |
if ($request_uri ~ "^(\/)index\.php\/(.*)") { | |
return 302 $1$2; |
OlderNewer