Helps you build things {one-line purpose}
{} = Explanations for this readme..
Maybe here is a small overview of how MyTool, should not be longer than 5 lines and you're invited to use emojis 👯.
| ;; Screenshot at https://twitter.com/swaroopch/status/903442255796633600 | |
| ;; Inspired by https://www.reddit.com/r/ethtrader/comments/6wxizf/single_best_feature_of_the_new_macbook/ | |
| ;; Code written for Spacemacs, will need adaptation to your Emacs setup | |
| ;; Spacemacs users: You may need to enable `spacemacs-misc` layer to ensure `request` package is installed. | |
| (defun dotspacemacs/user-config () | |
| "Configuration function for user code. | |
| This function is called at the very end of Spacemacs initialization after | |
| layers configuration. | |
| This is the place where most of your configurations should be done. Unless it is |
| (spaceline-define-segment foo | |
| "Foo Docs" | |
| (when (bound-and-true-p spaceline-foo-p) | |
| "Foo: TODO") | |
| :when active | |
| :global-override foo) | |
| (add-to-list 'spacemacs-spaceline-additional-segments '(foo)) | |
| (spaceline-spacemacs-theme '(foo)) |
| #!/usr/bin/env python | |
| from __future__ import absolute_import, division, print_function, unicode_literals | |
| import arrow | |
| import click | |
| click.disable_unicode_literals_warning = True | |
| def is_weekend(i): | |
| assert isinstance(i, arrow.Arrow) |
| # Before: I have a local Java or Django server running on port 8000 | |
| function expose_port { | |
| local_port=$1 | |
| shift | |
| ssh -vvv -i "$HOME/.ssh/aws.pem" -N -R "9000:localhost:8000" "[email protected]" | |
| } |
| (ns scratchpad.core | |
| (:require [monger.core :as mg] | |
| [monger.collection :as mc] | |
| [monger.query :as mq])) | |
| (def local-mongodb | |
| (.getDB (mg/connect-via-uri! "mongodb://127.0.0.1:27017/local") "local")) | |
| // https://github.com/xetorthio/jedis | |
| import redis.clients.jedis.Jedis; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.concurrent.ExecutionException; | |
| import java.util.concurrent.ExecutorService; | |
| import java.util.concurrent.Executors; | |
| import java.util.concurrent.Future; |
| → python server.py | |
| Run after this server starts : curl http://127.0.0.1:5000/?test=1 | |
| [2012-02-15 12:24:34,716] [werkzeug] [INFO] * Running on http://127.0.0.1:5000/ | |
| [2012-02-15 12:24:34,717] [werkzeug] [INFO] * Restarting with reloader | |
| Run after this server starts : curl http://127.0.0.1:5000/?test=1 | |
| [2012-02-15 12:24:36,459] [root] [INFO] Received data ImmutableMultiDict([('test', u'1')]) | |
| [2012-02-15 12:24:36,460] [root] [INFO] Closing connection! | |
| [2012-02-15 12:24:36,460] [werkzeug] [INFO] 127.0.0.1 - - [15/Feb/2012 12:24:36] "GET /?test=1 HTTP/1.1" 200 - | |
| [2012-02-15 12:24:36,460] [root] [INFO] In separate process, doing something with data {'test': [u'1']} |
| #!/usr/bin/env python | |
| import oauth2 as oauth # pip install oauth2 | |
| parameters = { | |
| 'oauth_version' : '1.0', | |
| 'oauth_nonce' : oauth.generate_nonce(), | |
| 'oauth_timestamp' : oauth.generate_timestamp(), | |
| } |