title | subtitle | author | date | source |
---|---|---|---|---|
npm vs Yarn Command Translation Cheat Sheet |
CLI commands comparison |
yarn |
February 15, 2020 |
This file contains hidden or 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
#!/usr/bin/env bash | |
# 'Wi-Fi' or 'Ethernet' or 'Display Ethernet' | |
INTERFACE=Wi-Fi | |
# Ask for the administrator password upfront | |
sudo -v | |
# Keep-alive: update existing `sudo` time stamp until finished | |
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & |
This file contains hidden or 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
version: '3' | |
services: | |
mssql-server-linux: | |
image: microsoft/mssql-server-linux:latest | |
volumes: | |
- mssql-server-linux-data:/var/opt/mssql/data | |
environment: | |
- ACCEPT_EULA=Y | |
- SA_PASSWORD=${SQLSERVER_SA_PASSWORD:-yourStrong(!)Password} |
This file contains hidden or 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 | |
class Html | |
{ | |
const REL_STYLESHEET = 'stylesheet'; | |
const REL_PRELOAD = 'preload'; | |
/** | |
* style css link tagı return eder. | |
*/ |
This file contains hidden or 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
public static function cleanPhoneNumber($number) | |
{ | |
return str_replace([' ', '(', ')', '-', '+', '.', '/', '_'], '', $number); | |
} | |
public static function getLast10Digits($number) | |
{ | |
return substr(self::cleanPhoneNumber($number), -10); | |
} |
- Edit as root: sudo editor /usr/share/pulseaudio/alsa-mixer/paths/analog-input-internal-mic.conf
- Edit as root: sudo editor /usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf
- Under "[Element Internal Mic Boost]" set "volume" to "zero".
- Under "[Element Int Mic Boost]" set "volume" to "zero".
- Under "[Element Mic Boost]" set "volume" to "zero".
If It's still same, then you can next other steps.
- edit the file below:
This file contains hidden or 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
# https://newbedev.com/exporting-data-from-mysql-docker-container | |
# delete first line from dump.sql file | |
docker-compose exec db mysqldump -u root -proot wordpress > dump.sql |
This file contains hidden or 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 updateQueryStringParam(key, value) { | |
let baseUrl = [location.protocol, '//', location.host, location.pathname].join(''), | |
urlQueryString = document.location.search, | |
newParam = key + '=' + value, | |
params = '?' + newParam; | |
// If the "search" string exists, then build params from it | |
if (urlQueryString) { | |
let updateRegex = new RegExp('([\?&])' + key + '[^&]*'); | |
let removeRegex = new RegExp('([\?&])' + key + '=[^&;]+[&;]?'); |
This file contains hidden or 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-switch () { | |
local phpVersion="$1" | |
sudo update-alternatives --set php /usr/bin/php"$1" > /dev/null | |
} |
This file contains hidden or 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
/** | |
birinci parametrede array alıyoruz ve array içerisinde string, integer tipinde veriler var | |
ve bunun içindeki bazı veri kümsenin sırasını önceliklendirmek istiyoruz. | |
Hangi veri kümsenin önceliklendirileceğini de ikinci parametrede alıyoruz. | |
İkinci parametre de array olacak. birebir birinci parametreyle aynı özelliklere sahip olacak. | |
ikinci parametrede array içerisindeki veriler, birinci parametredekiler verilerde birebir match arayarak | |
ikinci parametrenin index sıralamasına göre birebir aynı şekilde önceliklendirerek | |
birinci parametrenin sıralamasını güncelleyecek ve return edecek. |