Skip to content

Instantly share code, notes, and snippets.

View vwal's full-sized avatar

Ville Walveranta vwal

View GitHub Profile
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@dupuy
dupuy / README.rst
Last active April 23, 2024 23:38
Common markup for Markdown and reStructuredText

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

@lucdew
lucdew / json_postgres.js
Last active November 16, 2022 17:49
Example of json document storage in postgresql and querying (with knex.js)
var connectionString = 'postgres://localhost:5432/postgres';
var Promise=require('bluebird');
var knex = require('knex')({
client: 'pg',
connection: {
user: 'postgres',
database: 'postgres',
port: 5432,
@HugoPoi
HugoPoi / generateWhoisConf.js
Last active September 8, 2018 14:43
Generate /etc/whois.conf file for gnu whois command
/*
* Usage : node generateWhoisConf.js > /etc/whois.conf
*/
var json = require('comment-json');
var request = require('request');
request('https://github.com/weppos/whois/raw/master/data/tld.json', function(error, response, body){
var obj = json.parse(body);
Object.keys(obj).forEach(function(key){