Skip to content

Instantly share code, notes, and snippets.

Knitting the next thing

Rui rpbaltazar

Knitting the next thing
View GitHub Profile
View world_capitals.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Abu Dhabi
Addis Ababa
Andorra la Vella
rpbaltazar / Superhero names
Created Aug 16, 2016
super hero names - aka version name
View Superhero names

JavaScript Developer Questionnaire

1. Examine this script example.

var r = undefined;
a = b = c = 20;
n = i = r;

1.1 What will be the value of b after its execution?

2. Describe each part of a for loop structure.

O-I /
Last active Oct 27, 2020
[TIx 8] Weighted Random Sampling in Ruby

One of the many reasons I love working with Ruby is it has a rich vocabulary that allows you to accomplish your goals with a minimal amount of code. If there isn't a method that does exactly what you want, it's usually possible to build an elegant solution yourself.

Let's take the example of simulating the rolling of a die.

We can represent a die as an array of its faces.

die = [*?⚀..?⚅]
# => ["⚀", "⚁", "⚂", "⚃", "⚄", "⚅"]
XVilka /
Last active Nov 28, 2020
True Colour (16 million colours) support in various terminal applications and terminals

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
You can’t perform that action at this time.