A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Showing posts with label list. Show all posts
Showing posts with label list. Show all posts

Cloud development machines

 A list of cloud servers for basic hobby-level software development.

All prices per month:

  • DigitalOcean: $4 for 512Mb memory, 10Gb file storage, 500Gb transfer
    • $6 for 1Gb memory, 25Gb file storage, 1000Gb transfer
    • Block storage:
      • $10 for 100Gb
    • Object storage:
      • $5 for 250Gb, 1Tb outbound transfer
    • Images: $0.06/GiB/mo
      • = $1.50 for 25Gb
  • Vultr: $6 for 1Gb memory, 25Gb file storage, 2Tb transfer
    • Block storage: $1 per 10Gb
    • Object storage: $5 for 250Gb, 1Tb outbound transfer
  • Linode: $5 for 1Gb memory, 25Gb file storage, 1Tb transfer
    • Block storage: $1 per 10Gb
    • Object storage: $5 for 250Gb, 1Tb outbound transfer
    • Images:
      • $0.10 for 1Gb x 25
      • $2.50 for 25Gb x 25
  • Kamatera: $4 for 1Gb memory, 20Gb file storage, 5000Gb transfer
    • File storage:
      • $6 for 30Gb
      • $7 for 40Gb
      • $8 for 50Gb
      • $12 for 100Gb

Javascript web frameworks, 2022

 A list:

  • React - library, jsx, facebook
  • Vue - easier than backbone, good cli
  • Angular - typescript, heavy, google
  • Ember - opinionated, fast development <-- this one is good
  • Backbone - stable, reliable, data rendering, easy, lightweight
  • Aurelia - convention over configuration, standards, very easy
  • Lit - very fast, lightweight, google
  • Mithril - lean, fast, simple

How to manage schema migrations (track database changes)

A list. Alternatives to the popular/enterprise options:

Why Android is better then iPhone

A list:
  • Homescreen widgets
  • Custom homescreen launchers, e.g. Nova Launcher
  • Custom homescreen icon arrangement
  • Notifications persist visibly in status bar so you don't forget them
  • Plentiful game console emulators
  • Easily download files from web pages
  • Easily load mp3 music without special software
  • Save any file to the phone storage, like you can with Windows/Mac/Linux

Some icons for webpages

A list:

Shuffle lines in bash

#!/bin/bash
# Print out the lines from a file, in a random order
FILE=$1
if [[ -z $FILE ]]
then
    echo "usage: shuffle [filename]"
    exit 1
fi
for i in `cat $FILE`; do echo "$RANDOM $i"; done | sort | sed -r 's/^[0-9]+ //'

Thanks

Get unique values from an array in Perl

# Unique an array

@unique_list = keys %{{ map { $_ => 1 } @big_list }}; # aka dedupe a list

# Unique a hash on a specified key 'id'

@unique_list = values %{{ map { $_->{id} => $_ } %big_hash }};




Explanation

Perl: Subtract one list from another list

my @difference = grep { not ($_ ~~ \@small_array) } @big_array;


# ~~ is the smart matching operator

Comma separated lists in XSL

<xsl:if test="position() != last()">

Pass in an extra parameter to perl -n

Use an environment variable

for k in $(cat list_of_ids); do export KK=$k; perl -F"\t" -lane'print if ($F[3] eq $ENV{KK})' data/master_list_of_queries >> new_data_file; done