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 | |
#source directory path | |
backup_path=/var/www/application/uploads | |
#destination s3 bucketname | |
bucket_name=uploads | |
echo "Sync Process Start ::" $(date) |
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 | |
return PhpCsFixer\Config::create() | |
->setRules([ | |
'@Symfony' => true, | |
'align_multiline_comment' => true, | |
'array_syntax' => ['syntax' => 'short'], | |
'array_indentation' => true, | |
'blank_line_after_namespace' => true, | |
'blank_line_after_opening_tag' => true, |
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
const tls = require('tls'); | |
const https = require('https'); | |
const crypto = require('crypto'); | |
const axios = require('axios'); | |
function sha256(s) { | |
return crypto.createHash('sha256').update(s).digest('base64'); | |
} | |
const options = { |
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 axios from 'axios'; | |
import { Auth } from '.'; | |
let isRefreshing = false; | |
let refreshSubscribers = []; | |
axios.interceptors.response.use(response => { | |
return response; | |
}, error => { | |
const originalReq = error.config; |
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
/*::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/ | |
/*:: lat1, lon1 = Latitude and Longitude of point 1 (in decimal degrees) :*/ | |
/*:: lat2, lon2 = Latitude and Longitude of point 2 (in decimal degrees) :*/ | |
/*:: unit = the unit you desire for results :*/ | |
/*:: where: 'M' is statute miles (default) :*/ | |
/*:: 'K' is kilometers :*/ | |
/*:: 'N' is nautical miles :*/ | |
/*:: :*/ | |
/*::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/ |
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 | |
/** | |
* Logic to copy public files to s3 | |
*/ | |
$sourceFiles = \Storage::disk('public')->allFiles(); | |
$destinationFiles = \Storage::disk('s3')->allFiles(); | |
foreach ($sourceFiles as $file) { | |
if (!in_array($file, $destinationFiles)) { |
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
Step 1: | |
/* Create queries to set the sequences of the table with max of the table */ | |
SELECT 'SELECT SETVAL(' || | |
quote_literal(quote_ident(PGT.schemaname) || '.' || quote_ident(S.relname)) || | |
', COALESCE(MAX(' ||quote_ident(C.attname)|| '), 1) ) FROM ' || | |
quote_ident(PGT.schemaname)|| '.'||quote_ident(T.relname)|| ';' | |
FROM pg_class AS S, | |
pg_depend AS D, | |
pg_class AS T, | |
pg_attribute AS C, |
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
-- | |
-- Dump a PostgreSQL database into a file | |
-- container_name - PostgreSQL container name | |
-- db_user - user name to connect as. | |
-- db_name - name of the database to be dumped | |
-- -O - no-owner | |
-- -x - no-privileges | |
-- | |
docker exec -i [container_name] pg_dump --username [db_user] [db_name] -O -x > dump.sql |