Make sure everything is up to date.
2. Install Xcode and its "Command Line Tools"
- Go to App Store and install Xcode.
// 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() |
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' |
#!/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 |
# 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" |
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 |
CREATE USER 'user'@'IP' IDENTIFIED BY 'password'; | |
GRANT ALL PRIVILEGES ON `database`.* TO 'user'@'IP'; | |
FLUSH PRIVILEGES; |
<?php | |
namespace App\Http\Controllers\Web; | |
use Illuminate\Http\Request; | |
use App\Http\Requests; | |
use App\Http\Controllers\Controller; | |
class StaticController extends Controller |
Make sure everything is up to date.
#!/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 |
@php | |
$brazilianStates = [ | |
'AC' => 'Acre', | |
'AL' => 'Alagoas', | |
'AP' => 'Amapá', | |
'AM' => 'Amazonas', | |
'BA' => 'Bahia', | |
'CE' => 'Ceará', | |
'DF' => 'Distrito Federal', | |
'ES' => 'Espírito Santo', |