CARVIEW |
Select Language
HTTP/2 302
date: Mon, 21 Jul 2025 06:12:58 GMT
content-type: text/html; charset=utf-8
content-length: 0
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
location: https://gist.github.com/ayushgoel/70eff5e48afcc2d98b45.git
cache-control: no-cache
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
set-cookie: _gh_sess=rsDMOHtRSr9vGI%2Ft%2Bc3FrZ%2BnfF%2FuljzhZSCHeckCH89FPwMJWbafafCYKd%2Bsz503fsVUqkiqj5CuL5UjH4ngJIpyhldq5JMux2MXbbQs3APEO4FuBAVWleTaxtNUzKClZcVH1MVEh4KrDBw8ZGBBczEo%2FLJLNqn%2F6lw4Ekivzzw9N%2BmF8z6Act8Lnm3XPL4sRvWQ8izkNq4UgJ42DFEbORYWWOlg0LNhDsjcBlX8XxjL5jj7bxykJoe%2Btobr7b6JhA6rWVninz%2FyQHGSJ8kVKA%3D%3D--ye7FmCbfNnk%2BJ%2BC%2F--ddv04Y3bvkgYxI2zI6mETQ%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1987272913.1753078378; Path=/; Domain=github.com; Expires=Tue, 21 Jul 2026 06:12:58 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Tue, 21 Jul 2026 06:12:58 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: C542:110E0E:1508B25:1B235E1:687DDA6A
HTTP/2 301
date: Mon, 21 Jul 2025 06:12:58 GMT
content-type: text/html
content-length: 162
location: https://gist.github.com/ayushgoel/70eff5e48afcc2d98b45
server: github.com
x-frame-options: DENY
strict-transport-security: max-age=31536000; includeSubDomains; preload
x-github-request-id: C542:110E0E:1508B78:1B23620:687DDA6A
HTTP/2 200
date: Mon, 21 Jul 2025 06:12:59 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"da784d267aee7846990a1e1272d71428"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
x-github-request-id: C542:110E0E:1508BA5:1B23672:687DDA6A
Create a post file to be used in Jekyll aware blogs. · GitHub
Show Gist options
Save ayushgoel/70eff5e48afcc2d98b45 to your computer and use it in GitHub Desktop.
{{ message }}
Instantly share code, notes, and snippets.
Last active
January 27, 2022 18:46
-
Star
0
(0)
You must be signed in to star a gist -
Fork
0
(0)
You must be signed in to fork a gist
-
Save ayushgoel/70eff5e48afcc2d98b45 to your computer and use it in GitHub Desktop.
Create a post file to be used in Jekyll aware blogs.
This file contains hidden or 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
# Byte-compiled / optimized / DLL files | |
__pycache__/ | |
*.py[cod] | |
*$py.class | |
# Distribution / packaging | |
.Python | |
env/ | |
build/ | |
develop-eggs/ | |
dist/ | |
downloads/ | |
eggs/ | |
.eggs/ | |
lib/ | |
lib64/ | |
parts/ | |
sdist/ | |
var/ | |
*.egg-info/ | |
.installed.cfg | |
*.egg | |
This file contains hidden or 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
#!/usr/bin/env python | |
import argparse | |
import create_dir | |
import filename | |
import front_matter | |
VERSION = "0.1.0" | |
def create_post(posts_dir, post_extension, post_title): | |
print("Will create file in DIR = {}".format(posts_dir)) | |
file_name = filename.sample_filename(post_title, post_extension) | |
file_path = posts_dir + file_name | |
create_dir.create_dir_if_not_exists_already(posts_dir) | |
with open(file_path, "w") as f: | |
f.write(front_matter.front_matter(" ", " ", [" "])) | |
print("Did create file = {}".format(file_path)) | |
def main(args): | |
create_post(args.dir, args.ext, args.title) | |
if __name__ == "__main__": | |
parser = argparse.ArgumentParser(description = "Create sample post file to be used by Jekyll") | |
parser.add_argument("--dir", default = "_posts/", help = "Directory path to write the sample post in. Default: _posts/") | |
parser.add_argument("--ext", default = "md", help = "Extension type for the post. Default: .md") | |
parser.add_argument("--title", default = "title", help = "Title of the post. Default: title") | |
parser.add_argument("--version", action = "version", version = "%(prog)s {}".format(VERSION)) | |
args = parser.parse_args() | |
main(args) |
This file contains hidden or 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
#!/usr/bin/env python | |
import os | |
import argparse | |
def create_dir_if_not_exists_already(path): | |
if not os.path.exists(path): | |
os.makedirs(path) | |
def main(args): | |
if not args.path: | |
parser.error("Required argument path not given") | |
create_dir_if_not_exists_already(args.path) | |
if __name__ == "__main__": | |
parser = argparse.ArgumentParser(description = "Create a directory of given name if one does not exist already.") | |
parser.add_argument("--path", help = "Directory path to create.") | |
args = parser.parse_args() | |
main(args) |
This file contains hidden or 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
#!/usr/bin/env python | |
import datetime | |
import argparse | |
def filename(date, title, ext): | |
name = date + "-" + title | |
if ext: | |
name = name + "." + ext | |
return name | |
def date_for_filename(): | |
return datetime.date.today().isoformat() | |
def sample_filename(title, ext): | |
return filename(date_for_filename(), title, ext) | |
def main(args): | |
print(sample_filename(args.title, args.ext)) | |
if __name__ == "__main__": | |
parser = argparse.ArgumentParser(description = "Give filename for a given title according to Jekyll post.") | |
parser.add_argument("--title", default = "title", help = "Title for post. Default: title") | |
parser.add_argument("--ext", help = "Optional extension for filename.") | |
args = parser.parse_args() | |
main(args) |
This file contains hidden or 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
#!/usr/bin/env python | |
import argparse | |
def wrap(demarker, content): | |
return demarker + content + demarker | |
def add_front_matter(content, label, value): | |
if value: | |
content += "{0}: {1}\n".format(label, value) | |
return content | |
def front_matter(layout, category, tags): | |
content = "" | |
content = add_front_matter(content, "layout", layout) | |
content = add_front_matter(content, "category", category) | |
if tags: | |
content_tags = " ".join(tags) | |
content = add_front_matter(content, "tags", content_tags) | |
demarker = "---\n" | |
return wrap(demarker, content) | |
def main(args): | |
print(front_matter(args.layout, args.category, args.tags)) | |
if __name__ == "__main__": | |
parser = argparse.ArgumentParser(description = "Create YAML front matter to be used by Jekyll") | |
parser.add_argument("--layout", help = "Layout to be used.") | |
parser.add_argument("--category", help = "Category for the post.") | |
parser.add_argument("--tags", nargs = "*", help = "Tags for the post.") | |
args = parser.parse_args() | |
main(args) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can’t perform that action at this time.