An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
| $(function () { | |
| "use strict"; | |
| // for better performance - to avoid searching in DOM | |
| var content = $('#content'); | |
| var input = $('#input'); | |
| var status = $('#status'); | |
| // my color assigned by the server | |
| var myColor = false; |
An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
| 1. pip install -r reqs.pip | |
| 2. server.py | |
| 3. open client.html in browser | |
| 4. redis-cli publish push '123456' | |
| 5. check browser console |
| # MAC manipulators | |
| alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`' | |
| alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE' |
| class AllowPUTAsCreateMixin(object): | |
| """ | |
| The following mixin class may be used in order to support PUT-as-create | |
| behavior for incoming requests. | |
| """ | |
| def update(self, request, *args, **kwargs): | |
| partial = kwargs.pop('partial', False) | |
| instance = self.get_object_or_none() | |
| serializer = self.get_serializer(instance, data=request.data, partial=partial) | |
| serializer.is_valid(raise_exception=True) |
| from flask import Flask, request | |
| from nameko.standalone.rpc import ServiceRpcProxy | |
| app = Flask(__name__) | |
| @app.route('/') | |
| def task_list(): | |
| return """ | |
| <html> |
| *.pyc |
$ uname -r