James Sugrue [asked][1], "@GitHubAPI is there a way to find the number of stars for a given repository?"
$ curl -ni "https://api.github.com/search/repositories?q=more+useful+keyboard" -H 'Accept: application/vnd.github.preview'
{| import json | |
| from functools import wraps | |
| from flask import redirect, request, current_app | |
| def support_jsonp(f): | |
| """Wraps JSONified output for JSONP""" | |
| @wraps(f) | |
| def decorated_function(*args, **kwargs): | |
| callback = request.args.get('callback', False) | |
| if callback: |
| { | |
| "AL": "Alabama", | |
| "AK": "Alaska", | |
| "AS": "American Samoa", | |
| "AZ": "Arizona", | |
| "AR": "Arkansas", | |
| "CA": "California", | |
| "CO": "Colorado", | |
| "CT": "Connecticut", | |
| "DE": "Delaware", |
| /** | |
| * Dojo AMD Google Maps Loader Plugin | |
| */ | |
| define([ | |
| "dojo/_base/kernel", | |
| "dojo/topic" | |
| ], function (kernel, topic) { | |
| var w = kernel.global; | |
| var cb ="_googleApiLoadCallback"; |
| var pdf = new jsPDF(); | |
| pdf.text(0, 0, 'Hello World!'); | |
| var pdfBase64 = pdf.output('datauristring'); | |
| window.plugin.email.open({ | |
| to: ['to@email.com'], | |
| subject: 'New PDF!', | |
| body: 'Hi there, here is that new PDF you wanted!', | |
| isHTML: false, | |
| attachments: [pdfBase64] |
| #add 'node_modules' to .gitignore file | |
| git rm -r --cached node_modules | |
| git commit -m 'Remove the now ignored directory node_modules' | |
| git push origin <branch-name> |
| Format: YYYY-MM-DDTHH:mm:ss.sssZ | |
| Date: ^\d{4}(-\d{2}){0,2}$ | |
| Time: ^\d{2}(:\d{2}(:\d{2}(\.\d+)?)?)?$ | |
| Time with optional timezone: ^\d{2}(:\d{2}(:\d{2}(\.\d+)?)?)?(Z|[\+|-]\d{2}:\d{2})?$ | |
| Date and/or time with optional timezone: | |
| (^\d{4}(-\d{2}){0,2})?((^|T)\d{2}(:\d{2}(:\d{2}(\.\d+)?)?)?(Z|[\+|-]\d{2}:\d{2})?)?$ | |
| var traverse = function(o, fn) { | |
| for (var i in o) { | |
| fn.apply(this,[i,o[i]]); | |
| if (o[i] !== null && typeof(o[i])=="object") { | |
| traverse(o[i], fn); | |
| } | |
| } | |
| } | |
| // usage |
| LDAP_SERVER = "ldaps://my-ldap-server.com/" | |
| LDAP_BASE = "dc=my-ldap-server,dc=com" | |
| def users_ldap_groups(uid): | |
| """ Returns a list of the groups that the uid is a member of. | |
| Returns False if it can't find the uid or throws an exception. | |
| It's up to the caller to ensure that the UID they're using exists! | |
| """ | |
| logger.debug("uid: ", uid) |
| var zip = new JSZip(); | |
| var count = 0; | |
| var zipFilename = "zipFilename.zip"; | |
| var urls = [ | |
| 'http://image-url-1', | |
| 'http://image-url-2', | |
| 'http://image-url-3' | |
| ]; | |
| urls.forEach(function(url){ |