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
# Goto a directory you can write to: | |
cd ~ | |
#get composer: | |
curl -s https://getcomposer.org/installer | php | |
# move composer into a bin directory you control: | |
sudo mv composer.phar /usr/local/bin/composer | |
# double check composer works | |
composer about |
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
// gin will throw following for the first time due to secure initiate a http.Redirect but gin is unaware of it | |
// [GIN-debug] [WARNING] Headers were already written. Wanted to override status code 301 with 200 | |
package main | |
import ( | |
"github.com/gin-gonic/gin" | |
"github.com/unrolled/secure" | |
) |
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
AuthType Basic | |
AuthName "Password Protected Area" | |
AuthUserFile /path/to/.htpasswd | |
Require valid-user |
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
#!/bin/bash | |
##### find the last modified file (exclude folder) | |
# show files sorted by modification time in reverse order | |
alias lsr="ls -ctrla" | |
lsrexec(){ find . -maxdepth 1 -type f -exec ls -ctrA1 "{}" +; } | |
lsrlast(){ lsaexec | tail -n1; } | |
# example to find the last modified file with 'tar' in its name: lsagrep tar | |
lsrgrep(){ lsaexec | grep $1 | tail -n1; } |
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 laraveldbinfo() { | |
HOST=`perl -lne 's/(?<!^#)DB_HOST=(.*)/\1/ or next; print' .env` | |
NAME=`perl -lne 's/(?<!^#)DB_DATABASE=(.*)/\1/ or next; print' .env` | |
USERNAME=`perl -lne 's/(?<!^#)DB_USERNAME=(.*)/\1/ or next; print' .env` | |
PASSWORD=`perl -lne 's/(?<!^#)DB_PASSWORD=(.*)/\1/ or next; print' .env` | |
BACKUP_NAME="$NAME-$(date +%Y%m%d-%s).sql" | |
echo "password is $PASSWORD" | |
} | |
function laraveldblogin() { |
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
APP_NAME="My Sample Laravel App" | |
APP_ENV=testing | |
APP_KEY= | |
APP_DEBUG=true | |
APP_URL=http://localhost | |
LOG_CHANNEL=stack | |
DB_CONNECTION=mysql | |
DB_HOST=db-tests |
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
name: Laravel testing | |
on: | |
push: | |
branches: | |
- release | |
jobs: | |
phpunit: | |
runs-on: ubuntu-20.04 |
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
<html> | |
<title>Firebase Messaging Demo</title> | |
<style> | |
div { | |
margin-bottom: 15px; | |
} | |
</style> | |
<body> | |
<div id="token"></div> | |
<div id="msg"></div> |
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
importScripts("https://www.gstatic.com/firebasejs/7.16.1/firebase-app.js"); | |
importScripts( | |
"https://www.gstatic.com/firebasejs/7.16.1/firebase-messaging.js", | |
); | |
// For an optimal experience using Cloud Messaging, also add the Firebase SDK for Analytics. | |
importScripts( | |
"https://www.gstatic.com/firebasejs/7.16.1/firebase-analytics.js", | |
); | |
// Initialize the Firebase app in the service worker by passing in the |
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
<script> | |
var config = { | |
messagingSenderId: "YOUR-SENDER-ID", | |
apiKey: "YOUR_API_KEY", | |
projectId: "YOUR_PROJECT_ID", | |
appId: "YOUR_APP_ID" | |
}; | |
firebase.initializeApp(config); | |
</script> |
NewerOlder