Skip to content

Instantly share code, notes, and snippets.

View nanounanue's full-sized avatar
💭
😡

Adolfo De Unánue nanounanue

💭
😡
View GitHub Profile
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@nanounanue
nanounanue / rt-draw.py
Created September 4, 2019 05:27 — forked from sbourdelin/rt-draw.py
Draw plot in real time with matplotlib
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Savoir-Faire Linux Inc.
# Authors:
# Sebastien Bourdelin <sebastien.bourdelin@savoirfairelinux.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 2 as
# published by the Free Software Foundation.
@nanounanue
nanounanue / metropolis.css
Created August 30, 2019 02:13 — forked from vhodges/metropolis.css
A version of the Beamer theme Metropolis for reveal.js
/**
* A simple theme for reveal.js presentations, derived from serif.css
* It's in the spirit of the Metropolis theme for beamer https://github.com/matze/mtheme
*
* This theme is Copyright (C) 2016 Vince Hodges, http://sourdoughlabs.com - it is MIT licensed.
*/
@import url('https://fonts.googleapis.com/css?family=Fira+Sans');
.reveal a {
@nanounanue
nanounanue / worm-scraper.rb
Created May 15, 2019 19:58 — forked from stormbeta/worm-scraper.rb
Simple script to scrape Worm web serial chapters into aggregate HTML
#!/usr/bin/ruby
# Scrapes crude HTML representation of Worm (Parahumans) web serial chapters
require 'rubygems'
require 'nokogiri'
require 'open-uri'
# URL of first chapter
nextChapterUri = URI::encode("http://parahumans.wordpress.com/category/stories-arcs-1-10/arc-1-gestation/1-01/")

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link below in the summary jumps at the answer on this page.
  • The link on the question itself points back at the original post.

Summary

@nanounanue
nanounanue / .i3status.conf
Created April 11, 2019 22:19 — forked from onimenotsuki/.i3status.conf
Configuration files for i3wm in manjaro
# i3status configuration file.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
general {
colors = yes
@nanounanue
nanounanue / org-mode-reference-in.org
Created March 1, 2019 19:49 — forked from drj42/org-mode-reference-in.org
This is a cheat sheet for Emacs org-mode... in org-mode format!
@nanounanue
nanounanue / is_valid_date.sql
Created September 19, 2018 21:34
validate if a is a valid date (postgresql)
-- from https://dba.stackexchange.com/a/8835/16235
create function is_valid_date(text) returns boolean language plpgsql immutable as $$
begin
return case when $1::date is null then false else true end;
exception when others then
return false;
end;$$;
-- use:
@nanounanue
nanounanue / postgres_queries_and_commands.sql
Created September 19, 2018 18:16 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- 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%'
@nanounanue
nanounanue / test_rank.sql
Created September 17, 2018 07:38 — forked from nakagami/test_rank.sql
SQL functions RANK(), PERCENT_RANK(), CUME_DIST() and NTILE()
CREATE TABLE test_rank (
i integer,
s varchar(1)
);
INSERT INTO test_rank (i, s) VALUES (1, 'A');
INSERT INTO test_rank (i, s) VALUES (2, 'B');
INSERT INTO test_rank (i, s) VALUES (2, 'b');
INSERT INTO test_rank (i, s) VALUES (3, 'D');
INSERT INTO test_rank (i, s) VALUES (4, 'E');