Skip to content

Instantly share code, notes, and snippets.

@areina
areina / apitools_github_oauth.lua
Created April 23, 2014 16:01
Apitools middleware to provide a callback endpoint for github oauth
return function(request, next_middleware)
local CLIENT_ID = "foo"
local CLIENT_SECRET = "bar"
local APP_URL = "http://localhost:9000/#overview"
if request.uri == '/callback' then
local session_code = request.args["code"]
local url = "https://github.com/login/oauth/access_token"
local request_body = {
client_id = CLIENT_ID,
(defun t-pull-request()
(interactive)
(async-shell-command "hub pull-request")
(with-current-buffer "*Async Shell Command*"
(add-hook 'comint-output-filter-functions
'(lambda (txt)
(if (string-match-p "https" txt)
(browse-url txt)))
nil t)))
[~]$ curl http://foo:8086/db/bar/series\?u\=root\&p\=root\&q\=select%20sum\(value\)%20from%20service_31189720689_metric_79198034909.1m%20where%20time%20%3E%20%272010-09-01%2000%3A00%3A00.000%27%20AND%20time%20%3C%20%272010-09-30%2023%3A59%3A59.000%27
[{"name":"service_31189720689_metric_79198034909.1m","columns":["time","sum"],"points":[[0,1.020721e+06]]}]%
[~]$ curl http://foo:8086/db/bar/series\?u\=root\&p\=root\&q\=select%20value%20from%20service_31189720689_metric_79198034909.1m%20where%20time%20%3E%20%272010-09-01%2000%3A00%3A00.000%27%20AND%20time%20%3C%20%272010-09-30%2023%3A59%3A59.000%27
[{"name":"service_31189720689_metric_79198034909.1m","columns":["time","sequence_number","value"],"points":[[1283299200000,72026860001,1020721]]}]%
@areina
areina / org-protocol-elfeed.md
Last active August 29, 2015 14:12
Snippets for subscribe feeds with elfeed (emacs) from conkeror

In your emacs files:

(defun org-protocol-elfeed (data)
  (let ((url (org-protocol-sanitize-uri data)))
    (elfeed-add-feed url)
    (customize-save-variable 'elfeed-feeds elfeed-feeds)))

(add-to-list 'org-protocol-protocol-alist
             '("Subscribe to feed with elfeed."
(defn foo-root [component]
(fn [data _owner]
(reify
om/IRender
(render [_]
(let [ctor (js/React.createFactory
(js/React.createClass
#js
{
:getDisplayName (fn [] "muiroot-context")
strace -f -p 890
strace: Process 890 attached
futex(0x557420eb0508, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, ffffffff) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
futex(0x557420eb0508, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, ffffffff <unfinished ...>
+++ killed by SIGKILL +++
@areina
areina / gist:8f4852b9e352468c7c0f747b11444c66
Created October 16, 2017 16:25
error - ansible provisioning
The full traceback is:
File "/tmp/ansible_NvoXyJ/ansible_modlib.zip/ansible/module_utils/basic.py", line 2744, in run_command
cmd = subprocess.Popen(args, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
[WARNING]: As of Ansible 2.4, the parameter 'executable' is no longer
supported with the 'command' module. Not using '/bin/bash'.