#!/usr/bin/env python | |
import pynvim, os, re, sys, time | |
# Get a list of buffers that haven't been deleted. `nvim.buffers` includes | |
# buffers that have had `:bdelete` called on them and aren't in the buffer | |
# list, so we have to filter those out. | |
def get_listed_buffers(nvim): | |
return set(buf.number for buf in nvim.buffers \ | |
if nvim.eval('buflisted(%d)' % buf.number)) |
ssh user@remote gpg --export-secret-key KeyId | gpg --allow-secret-key-import --import |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
When hosting a project on GitHub, it's likely you'll want to use GitHub Pages to host a public web site with examples, instructions, etc. If you're not using a continuous integration service like Travis, keeping your gh-pages site up to date requires continuous wrangling.
The steps below outline how to use Travis CI with GitHub Releases and GitHub Pages to create a "1-button" deployment workflow. After testing and running a release build, Travis will upload your release assets to GitHub. It will also push a new version of your public facing site to GitHub Pages.
Let's assume you are hosting a JavaScript project that will offer a single JavaScript file as a release asset. It's likely you'll organize your files like this.
using level-sublevel, level-sec and validimir to have
- validations
- schema documentation
- schema enforcement
- index definitions
if diff_size == 0: | |
desc = "a code review of unknown size" | |
elif diff_size < 2: | |
desc = "a wee code review" | |
elif diff_size < 5: | |
desc = "a tiny code review" | |
elif diff_size < 30: | |
desc = "a small code review" | |
elif diff_size < 100: | |
desc = "a medium-size code review" |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
#!/bin/sh | |
# | |
# Runs node.js against script, logging to a logfile. We have to do | |
# this because there's no way to call node directly and have start-stop-daemon | |
# redirect stdout to a logfile. | |
# | |
LOGFILE=/var/log/node/node-application.log | |
NODE=/usr/local/bin/node | |
JAVASCRIPT=/var/apps/node-application/app.js |