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 | |
function convertToVueI18n($filePath) | |
{ | |
$safeList = [ | |
'getInitials(auth.user?.name)', | |
'item.title', | |
'label', | |
'title', | |
'description', |
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
// Create an array | |
Array.from({ length: 100 }, (v, i) => i) | |
// Copy to clipboard | |
const copyToClipboard = (content) => navigator.clipboard.writeText(content) | |
copyToClipboard("Hello fatfish") | |
// Get mouse selection | |
const getSelectedText = () => window.getSelection().toString() | |
getSelectedText() |
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
export default async () => { | |
if (!window.Notification) { | |
console.log('Browser does not support notifications.') | |
return | |
} | |
if (Notification.permission === 'granted') { | |
const not = new Notification('Hi there', { | |
body: 'How are you doing?', | |
icon: 'https://cdn-icons-png.flaticon.com/512/4980/4980801.png' |
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
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo "You have to provide a server name" | |
exit 1 | |
fi | |
echo "Connecting to server: $1" | |
case $1 in |
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
mysqldump --set-gtid-purged=OFF -h host -u user -p database > database.sql | |
mysql -h host -u user -p database < database.sql | |
# Clone a database | |
mysqldump db_name | mysql new_db_name |
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
CREATE USER 'user'@'IP' IDENTIFIED BY 'password'; | |
GRANT ALL PRIVILEGES ON `database`.* TO 'user'@'IP'; | |
FLUSH PRIVILEGES; |
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
#!/bin/bash | |
wget http://wordpress.org/latest.tar.gz | |
tar xfz latest.tar.gz | |
mv wordpress/* ./ | |
rmdir ./wordpress/ | |
rm -f latest.tar.gz | |
mkdir wp-content/languages | |
mv wp-config-sample.php wp-config.php |
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 | |
$brazilianStates = [ | |
'AC' => 'Acre', | |
'AL' => 'Alagoas', | |
'AP' => 'Amapá', | |
'AM' => 'Amazonas', | |
'BA' => 'Bahia', | |
'CE' => 'Ceará', | |
'DF' => 'Distrito Federal', | |
'ES' => 'Espírito Santo', |
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
# Git | |
alias gaa="git add ." | |
alias gc="git commit" | |
alias gcm="git checkout master" | |
alias gs="git status -s" | |
alias gpl="git pull" | |
alias gps="git push" | |
alias gf="git fetch" | |
alias glog='git log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate' | |
alias glogf="glog --numstat" |
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 | |
namespace App\Http\Controllers\Web; | |
use Illuminate\Http\Request; | |
use App\Http\Requests; | |
use App\Http\Controllers\Controller; | |
class StaticController extends Controller |
NewerOlder