Skip to content

Instantly share code, notes, and snippets.

@Su-Shee
Su-Shee / perfect-ui.txt
Last active August 7, 2022 12:33
My Perfect (G)UI Random Thoughts
Perfect UI has context
Middle is what I'm doing, surroundings change dynamically
Recently read that somebody wanted middle of their code editor be edit and
surroundings display usage, libraries, source of the code use
Why would I want "a browser" be a real separate window/application, if it
could be just a scalable/dragdrop component around my editing things
@Su-Shee
Su-Shee / Dockerfile.postgres-build
Last active August 7, 2022 12:00
Build Postgres in Docker
FROM ubuntu:16.10
# update the repository
RUN apt-get update --fix-missing
# install some basics
RUN apt-get install -y vim curl wget dialog net-tools \
build-essential strace \
perl libperl-dev python python-dev libxml2-dev libxslt-dev \
libreadline-dev zlib1g-dev \
@Su-Shee
Su-Shee / timeline 1986
Created December 8, 2016 12:50
teenage behavior archeology
reset
unset key
set terminal pngcairo size 900,500 enhanced font "Verdana, 10"
set output "teenage.png"
unset title
#set grid xtics lt 0 lw 2 lc rgb "#990076"
@Su-Shee
Su-Shee / GnuPlot Coffee Time Plot
Created December 6, 2016 16:15
GnuPlot Coffee Time Plot
reset
unset key
set terminal pngcairo size 900,600 enhanced font "Verdana, 10"
set output "coffee.png"
unset title
set format x ''
#!/usr/bin/env perl
use Mojolicious::Lite;
use Cwd;
@ARGV = qw(daemon --listen http://*:5000);
app->static->paths->[0] = getcwd;
# needed to setup the usual index.html landing
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use ZMQ::LibZMQ4;
use ZMQ::Constants qw/:all/;
@Su-Shee
Su-Shee / gist:285ceeaf126add1e9a11
Last active October 25, 2015 16:47
Falsehoods programmers cannot believe about non-existing things
There is a huge body of valid and yet faked or non-existing things you can use freely e.g. for testing purposes:
* The "Null Island" being a geographical convenience, non-existing island: "Null Island is a fictional island in the Gulf of Guinea
added to the Natural Earth public domain map dataset, located where the equator crosses the prime meridian, at coordinates 0°N 0°E."
see details: https://en.m.wikipedia.org/wiki/Null_Island - it even has a fake travel website :)
http://www.nullisland.com/travel.html
* On TV, you see the recurring fake phone number: https://en.wikipedia.org/wiki/Fictitious_telephone_number
@Su-Shee
Su-Shee / gist:159affbedef20f0b7a01
Last active October 19, 2015 19:38
my hommus recipe
USE HOME-COOKED CHICKPEAS AS BASE. NOT THE STUFF FROM CANS.
cook chickpeas without anything. they freeze well, so make as much as you want. cook them SOFT.
roughly:
* 1 cup of chickpeas
* 2-3 spoons of tahin
* 2-3 spoons of olive oil
* 2-4 spoons of lemon juice (to taste, I like with more)
#server
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use ZMQ::LibZMQ4;
use ZMQ::Constants qw/:all/;
I have a cheap validation regex for UUIDs on routes - mostly to distinguish :stuff
my $uuid = qr/[[:xdigit:]]{8}-([[:xdigit:]]{4}-){3}[[:xdigit:]]{12}/;
I use it like so:
$r->get('/comments/:object' => [ object => $uuid ])
->to('comments#list_by_item');
or, like this: