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
| console.log("start"); | |
| $("li").click(function () { | |
| console.log("click event start"); | |
| $(this).slideUp(1000).css('background', 'orange'); | |
| $("<li>1234</li>").appendTo($("ul:last")); | |
| console.log("click event end"); | |
| }); | |
| console.log("end"); |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Title</title> | |
| </head> | |
| <body> | |
| <ul id="dishes"> | |
| <li data-id="123">asdsadsadada</li> |
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
| import random | |
| import datetime | |
| import collections | |
| import pymongo | |
| client = pymongo.MongoClient() | |
| db = client.get_database('udi123') |
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 python3 | |
| import random | |
| from PIL import Image | |
| def main(source, target, cols, rows): | |
| im = Image.open(source) | |
| print("Original image size: {}x{}".format(*im.size)) | |
| w, h = im.size |
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
| from pprint import pprint | |
| import pymongo | |
| client = pymongo.MongoClient() | |
| db = client.get_database('socialagg') | |
| # db = client['socialagg'] | |
| pages = db.get_collection('pages') |
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
| from pprint import pprint | |
| import pymongo | |
| client = pymongo.MongoClient() | |
| db = client.get_database('socialagg') | |
| # db = client['socialagg'] | |
| pages = db.get_collection('pages') |
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
| import requests | |
| import secrets | |
| URL = "https://graph.facebook.com/oauth/access_token" | |
| r = requests.get(URL, { | |
| 'client_id': secrets.APP_ID, | |
| 'client_secret': secrets.APP_SECRET, | |
| 'grant_type': 'client_credentials', |
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
| from bottle import route, run, template | |
| @route('/hello/<name>') | |
| def index(name): | |
| return template('<b>Hello {{name}}</b>!', name=name) | |
| if __name__ == "__main__": | |
| run(debug=True, reloader=True) |
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
| # http://wsgi.tutorial.codepoint.net/environment-dictionary | |
| # ================================================================= | |
| # THE WSGI APPLICATION | |
| # ================================================================= | |
| def simple_app(environ, start_response): | |
| status = '200 OK' | |
| response_headers = [ | |
| ('Content-type', 'text/plain'), |
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
| SEP_RE = re.compile(r'\n+-{5,}\n+') | |
| def read_file(name): | |
| with (pathlib.Path(__file__).parent / 'content' / '{}.md'.format( | |
| name)).open() as f: | |
| return f.read() | |
| def get_item(txt): | |
| md = markdown.Markdown(extensions=['markdown.extensions.meta']) | |
| html = md.convert(txt) |