Skip to content

Instantly share code, notes, and snippets.

View sagar290's full-sized avatar
🏠
Working from home

Sagar sagar290

🏠
Working from home
View GitHub Profile
@sagar290
sagar290 / .env
Created April 20, 2020 17:07
LAMP .env
MYSQL_ROOT_PASSWORD=admin
MYSQL_USER=admin
MYSQL_PASSWORD=123
REPLICATION_USER=replication_user
REPLICATION_PASSWORD=myreplpassword
MYSQL_SLAVE_ONE_ROOT_PASSWORD=admin
MYSQL_SLAVE_ONE_USER=slave
MYSQL_SLAVE_ONE_PASSWORD=mysqlpwd
@sagar290
sagar290 / docker-compose.yml
Last active April 21, 2020 08:50
mysql master slave
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:
<?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' ) ) {
<?php
$text = 'sadasda{test}aasdasa asda {test2}';
preg_match_all("/{[^.}]*}/", $text, $var);
//$var = str_ireplace(['{', '}'], '', $var[0][0]);
var_dump($var);
@sagar290
sagar290 / .gitlab-ci.yml
Last active January 4, 2021 21:39
gitlab ci/cd for postman collection to html documentation
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
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))
import boto3
s3 = boto3.client('s3')
for obj in s3.list_objects_v2(Bucket="lms10", Prefix="adm/")['Contents']:
print(obj['Key'])
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;
}
package main
import (
"io"
"log"
"net/http"
)
func d(res http.ResponseWriter, req *http.Request) {
io.WriteString(res, "dog dog dog")
@sagar290
sagar290 / mamp-sql-dump-export.sh
Created February 25, 2021 18:25 — forked from oliveratgithub/mamp-sql-dump-export.sh
MAMP MySQL dump export using Terminal.app in macOS
$ cd /Applications/MAMP/Library/bin/
$ ./mysqldump --host=localhost -uroot -proot source_database > ~/Desktop/database_name-dump.sql