Skip to content

Instantly share code, notes, and snippets.

View rnkn's full-sized avatar

Paul W. Rankin rnkn

View GitHub Profile
@BD3i
BD3i / selected_option.html.ep
Created January 11, 2024 12:46
mojolicious select_field with selected option
<%
# this version works with index based numeric value keys
# note if you're storing this numeric value somewhere,
# you can never re-order the values and can only add to the end of the list
my $home_shows = 2; # current value
my $i = 0;
my @options = map { $i == $home_shows ? [$_ => $i++, selected => undef] : [$_ => $i++] }
qw(latest popular profile);
%>
<label class="label" for="home-shows">home shows</label>
@rougier
rougier / nano.el
Created October 2, 2020 17:44
A very minimal emacs configuration
;; nano.el -- A very minimal emacs
;; Usage: emacs -q -l nano.el
;;
;; Copyright (C) 2020 Nicolas .P Rougier
;;
;; Author: Nicolas P. Rougier <nicolas.rougier@inria.fr>
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
@aleb
aleb / pitivi.rb
Last active November 8, 2019 12:00
Homebrew formula for building Pitivi
class Pitivi < Formula
# Required to create a virtualenv with Matplotlib.
include Language::Python::Virtualenv
desc "Powerful and easy to use video editor"
homepage "http://www.pitivi.org"
url "https://download.gnome.org/sources/pitivi/0.999/pitivi-0.999.tar.xz"
sha256 "cb6f8a831383e698c2117ca7caec77b8167a6b2e2b0fb9c375e6a4f7c815b757"
head do
@mruwek
mruwek / topydo-url-open.py
Last active June 12, 2019 07:22
URL extractor/opener for topydo
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import sys
import subprocess
BROWSER='google-chrome'
# John Gruber's regex from http://daringfireball.net/2010/07/improved_regex_for_matching_urls