Skip to content

Instantly share code, notes, and snippets.

View sid22's full-sized avatar
😃

Siddharth Goyal sid22

😃
View GitHub Profile
@sid22
sid22 / sync_code.sh
Created August 18, 2021 19:04
Sync Local and VM Git Repos
#!/bin/bash
POSITIONAL=()
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
-l|--localpath)
LCPATH="$2"
shift # past argument
shift # past value
class CustomManifestS3Boto3Storage(ManifestFilesMixin, S3Boto3Storage):
# FIXME this seems to be a bug in ManifestFilesMixin with S3Boto3Storages
# ManifestFilesMixin is expecting a FileNotFound error but
# S3Boto3Storages is throwing an IOError
manifest_location = os.path.abspath(
settings.BASE_DIR
)
manifest_storage = FileSystemStorage(location=manifest_location)
def read_manifest(self):
class CustomManifestS3Boto3Storage(ManifestFilesMixin, S3Boto3Storage):
def read_manifest(self):
try:
return super(StaticStorage,self).read_manifest()
except IOError:
return None
if USE_S3:
# aws settings
AWS_S3_OBJECT_PARAMETERS = {
"CacheControl": "max-age=34608000",
}
AWS_ACCESS_KEY_ID = os.getenv("AWS_ACCESS_KEY_ID")
AWS_SECRET_ACCESS_KEY = os.getenv("AWS_SECRET_ACCESS_KEY")
AWS_STORAGE_BUCKET_NAME = os.getenv("AWS_STORAGE_BUCKET_NAME")
AWS_DEFAULT_ACL = "public-read"
CLOUDFRONT_ID = os.environ.get("CLOUDFRONT_ID")
@sid22
sid22 / Sublime custom cpp build system, macos Mojave
Created October 17, 2018 22:48
Build system to compile and run c++ files and take input from 'in' file and give output to 'out' file
{
"shell_cmd" : "g++ -std=c++14 $file_name -o $file_base_name && ./$file_base_name < in.txt > out.txt",
"selector": "source.c++ , source.cpp",
"working_dir" : "$file_path",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$"
}