Skip to content

Instantly share code, notes, and snippets.

@dmckean
dmckean / kinstapaper.py
Created April 8, 2016 05:47
A simple HTTP server for downloading MOBI files from Instapaper, suitable for use from a Kindle browser.
#! /usr/bin/env python
"""
A simple HTTP server for downloading MOBI files from Instapaper
In addition to username, password, a list of folder names and ids
must be provided to access Instapaper folders. These IDs may be
found in instapaper folder URLs, e.g.
https://www.instapaper.com/u/folder/(id)/(name)
Leave the id to `None` to reach the home Instapaper folder
USAGE: kinstapaper.py [-h] USERNAME PASSWORD ...
"""
@joepie91
joepie91 / promises-reading-list.md
Last active June 25, 2023 09:12
Promises (Bluebird) reading list

Promises reading list

This is a list of examples and articles, in roughly the order you should follow them, to show and explain how promises work and why you should use them. I'll probably add more things to this list over time.

This list primarily focuses on Bluebird, but the basic functionality should also work in ES6 Promises, and some examples are included on how to replicate Bluebird functionality with ES6 promises. You should still use Bluebird where possible, though - they are faster, less error-prone, and have more utilities.

I'm available for tutoring and code review :)

You may reuse all gists for any purpose under the WTFPL / CC0 (whichever you prefer).

@tsudoko
tsudoko / long-live-pomf.md
Last active November 4, 2019 03:29
Pomf.se alternatives

Moved to GitHub due to requests, see

@janko
janko / 01-presentation.md
Last active June 6, 2019 23:58
PostgreSQL full-text search capabilites (my presentation from our local Ruby meetup)

Full-text search

  • Keywords

  • Typos

  • Stemming

  • Stopword ignore

@romainl
romainl / _rnb.md
Last active August 12, 2021 21:56
RNB, a Vim colorscheme template
@kathawala
kathawala / bigpkg.sh
Created January 17, 2015 20:41
Prints out a list of all pacman packages sorted by size from largest to smallest
#!/bin/bash
( echo "PACKAGE SIZE(K)";
for A in /var/lib/pacman/local/*/desc; do
egrep -A1 '%(NAME|SIZE)' $A \
| gawk '/^[a-z]/ { printf "%s ", $1 }; /^[0-9]/ { printf "%.0f\n", $1/1024 }'
done | sort -nrk2 ) | column -t

Weechat Highlight Monitoring Without Script

Requires at least Weechat 1.0 with Trigger and Exec plugin.

This gist is not intended to make [highmon.pl][1] or [any other highlight monitoring script][2] obsolete. Trigger is very limited. It can't do complex stuffs. We will only create the basic function of highlight monitoring: collect lines that contain highlight and put them all in a buffer.

First we need a trigger that will active everytime there's line printed on weechat's buffer.

anonymous
anonymous / push.sh
Created June 15, 2014 12:33
#!/usr/bin/bash
# Usage: push.sh [task] <args>
# -- Options --
local_temp_directory=/tmp
ssh_host=some-server.asdf
screenshot_dir="~/screenshots"
# How to install `ipkg` on a Synology DS214
After a couple of days of trying to get `ipkg` woking on my DS214 I found [this article](https://github.com/trepmag/ds213j-optware-bootstrap) by [trepmag](https://github.com/trepmag). It is written for the DS213j, but it’s been working for me and [others](https://github.com/alberthild) for the DS214 too.
I have done some minor changed to clarify some things, but if you are a Linux guy (unlike me) my changes might be of no use to you.
## Guide
@gruber
gruber / Liberal Regex Pattern for Web URLs
Last active April 22, 2024 19:02
Liberal, Accurate Regex Pattern for Matching Web URLs
The regex patterns in this gist are intended only to match web URLs -- http,
https, and naked domains like "example.com". For a pattern that attempts to
match all URLs, regardless of protocol, see: https://gist.github.com/gruber/249502
# Single-line version:
(?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|s