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
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<password>'; | |
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '<password>'; |
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
$ cd /Applications/MAMP/Library/bin/ | |
$ ./mysqldump --host=localhost -uroot -proot source_database > ~/Desktop/database_name-dump.sql |
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
package main | |
import ( | |
"io" | |
"log" | |
"net/http" | |
) | |
func d(res http.ResponseWriter, req *http.Request) { | |
io.WriteString(res, "dog dog dog") |
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
server { | |
server_name server.com; | |
root /var/www/html/backend/public; | |
index index.html index.php; | |
location / { | |
try_files $uri $uri/ /index.php?$query_string; | |
} |
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
import boto3 | |
s3 = boto3.client('s3') | |
for obj in s3.list_objects_v2(Bucket="lms10", Prefix="adm/")['Contents']: | |
print(obj['Key']) |
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
import pandas as pd | |
import requests | |
import json | |
import sched, time | |
import base64 | |
from bs4 import BeautifulSoup as BSHTML | |
# print(df.to_json(orient = 'index', indent = 2)) | |
# print(df.to_json(orient='records', indent = 2)) |
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
pages: | |
stage: deploy | |
script: | |
- curl -o "docgen" https://raw.githubusercontent.com/thedevsaddam/docgen-bin/master/latest/linux_amd64 | |
- chmod +x ./docgen | |
- ./docgen build -i collection.json -o ./index.html | |
- mkdir .public | |
- cp -r index.html .public | |
- mv .public public | |
- rm docgen |
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 | |
$text = 'sadasda{test}aasdasa asda {test2}'; | |
preg_match_all("/{[^.}]*}/", $text, $var); | |
//$var = str_ireplace(['{', '}'], '', $var[0][0]); | |
var_dump($var); |
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 | |
add_filter( 'rest_authentication_errors', function( $result ) { | |
if ( ! empty( $result ) ) { | |
return $result; | |
} | |
if ( ! is_user_logged_in() ) { | |
return new WP_Error( 'rest_not_logged_in', 'You are not currently logged in.', array( 'status' => 401 ) ); | |
} | |
if ( ! current_user_can( 'administrator' ) ) { |
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
version: '2' | |
services: | |
mysql_db_master: | |
image: mysql:5.7 | |
environment: | |
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} | |
MYSQL_USER: ${MYSQL_USER} | |
MYSQL_PASSWORD: ${MYSQL_PASSWORD} | |
MYSQL_ROOT_HOST: 0.0.0.0 | |
ports: |