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
#Copyright 2022 Google LLC. | |
#SPDX-License-Identifier: Apache-2.0 | |
import os | |
import psutil | |
from google.cloud.storage import Client | |
def get_mem_mb(): | |
return psutil.Process().memory_info().rss / (1024 * 1024) |
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
#Copyright 2022 Google LLC. | |
#SPDX-License-Identifier: Apache-2.0 | |
bq --location="EU" load \ | |
--replace \ | |
--source_format="NEWLINE_DELIMITED_JSON" \ | |
--autodetect \ | |
your_dataset.your_table \ | |
./logs.jsonl |
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: '3.3' | |
services: | |
db: | |
image: mysql:5.7 | |
volumes: | |
- db_data:/var/lib/mysql | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: somewordpress |
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
apt-get update | |
echo "[Install] Build essential" | |
sudo apt-get install build-essential | |
echo "[Install] Python software properties" | |
apt-get install python-software-properties | |
echo "[Install] git" | |
apt-get install git |
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
$to = array('[email protected]'); | |
// setup Swift mailer parameters | |
$transport = Swift_SmtpTransport::newInstance( 'smtp.sendgrid.net', 465, 'ssl'); | |
$transport->setUsername('aymanfarhat '); | |
$transport->setPassword('mypass'); | |
$swift = Swift_Mailer::newInstance( $transport ); | |
// create a message (subject) |
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
def file_to_list(fname): | |
f = open(fname) | |
lst = f.readlines() | |
return [line.rstrip('\n') for line in lst] | |
def list_to_file(fname, lst): | |
f = open(fname, "w") | |
f.write("\n".join(lst)) |
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/sh | |
if [ -z "$1" ] ; then | |
echo "usage: $0 <projectname> [/path/to/project]" | |
exit 1 | |
fi | |
MYPROJECT=$1 | |
if [ -z "$2" ] ; then |
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
- Tab vs spaces | |
- Common Git workflow | |
- Code style to enforce | |
- variable naming conventions | |
- function naming convention | |
- Namespaces | |
- check PSR | |
- semantic versioning (http://semver.org/) | |
- JS linting with JSHint | |
- CSS pre-processor SASS vs LESS |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<link rel="shortcut icon" href="../../assets/ico/favicon.ico"> |
NewerOlder