Last active
May 5, 2020 20:40
-
-
Save ramene/bdab47ba65d895156c40757ebfa259c1 to your computer and use it in GitHub Desktop.
Revisions
-
ramene revised this gist
May 5, 2020 . No changes.There are no files selected for viewing
-
ramene revised this gist
May 4, 2020 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -12,9 +12,8 @@ gist_url = 'https://gist.github.com/{:s}.json'.format(sys.argv[1]) gist = json.loads(urlopen(gist_url).read()) html = gist['div'] # stylesheet = urlopen(gist['stylesheet']).read() with open('{:s}.vue'.format(COMPONENT_NAME), 'w') as f: f.write('<template>{:s}</template>'.format(html)) f.write("<script>export default {{ name: '{:s}' }}</script>".format(COMPONENT_NAME)) -
ramene revised this gist
May 4, 2020 . 1 changed file with 32 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ import urllib2 import json import datetime import time token = "YOUR_TOKEN" access_url = "https://api.github.com/gists" filename = "file.txt" description = "the description for this gist" public = "true" information = "some info" date = datetime.date.today() current_time = time.strftime("%H:%M:%S") data = """{ "description": "%s", "public": %s, "files": { "%s": { "content": "info : %s,date: %s, current_time: %s" } } }""" json_data = data % (description, public, filename, information, date, current_time) req = urllib2.Request(access_url) req.add_header("Authorization", "token {}".format(token)) req.add_header("Content-Type", "application/json") urllib2.urlopen(req, data=json_data) -
ramene revised this gist
May 4, 2020 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -12,8 +12,7 @@ gist_url = 'https://gist.github.com/{:s}.json'.format(sys.argv[1]) gist = json.loads(urlopen(gist_url).read()) html = gist['div'] stylesheet = urlopen(gist['stylesheet']).read() with open('{:s}.vue'.format(COMPONENT_NAME), 'w') as f: f.write('<template>{:s}</template>'.format(html)) -
ramene revised this gist
May 4, 2020 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -13,8 +13,7 @@ gist = json.loads(urlopen(gist_url).read()) html = gist['div'] # stylesheet = urlopen(gist['stylesheet']).read().decode() stylesheet = urlopen(gist['stylesheet']).read().encode('utf-8').decode() with open('{:s}.vue'.format(COMPONENT_NAME), 'w') as f: f.write('<template>{:s}</template>'.format(html)) -
ramene revised this gist
May 4, 2020 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,9 @@ gist_url = 'https://gist.github.com/{:s}.json'.format(sys.argv[1]) gist = json.loads(urlopen(gist_url).read()) html = gist['div'] # stylesheet = urlopen(gist['stylesheet']).read().decode() stylesheet = urlopen(gist['stylesheet']).read().encode().decode() with open('{:s}.vue'.format(COMPONENT_NAME), 'w') as f: f.write('<template>{:s}</template>'.format(html)) -
ramene created this gist
May 4, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ #!/usr/bin/env python try: from urllib.request import urlopen except ImportError: from urllib2 import urlopen import json import sys # Modify COMPONENT_NAME to name your component differently. COMPONENT_NAME = 'Gist' gist_url = 'https://gist.github.com/{:s}.json'.format(sys.argv[1]) gist = json.loads(urlopen(gist_url).read()) html = gist['div'] stylesheet = urlopen(gist['stylesheet']).read() with open('{:s}.vue'.format(COMPONENT_NAME), 'w') as f: f.write('<template>{:s}</template>'.format(html)) f.write("<script>export default {{ name: '{:s}' }}</script>".format(COMPONENT_NAME)) f.write('<style>{:s}</style>'.format(stylesheet))