Pages

Sunday, February 25, 2024

reverse order of csv

you can't sort asc/desc like sql and even if you did its probably not what you want. Made that mistake once, sorted all the sentences alphabetically. didn't notice till after I saved rendering it unintelligible.

using tails it prints the last 10 lines of a file but you can use the -n 100 option to show 100 lines.

the -r option reverses it.

tail -n 100 data.csv > temp.csv && mv temp.csv data.csv

on a-shell mini its not letting me pipe it into a temp file so im just going to make a new one called rev-data.csv

Why?
my "sharelinks page" where the links are dynamically generated from a csv is starting to get long. I changed my mind, now I want the new links at the top.

Thursday, February 22, 2024

create square quote pics with pablo

canva is bloat this ones better
pablo
nice simple web app without all the bells and whistles
for making those square insta quotes/memes

reveal js

saw a video of a woman who made 175 instagram quote pictures generated using canva's csv to image.
but unfortunately when I went to try it they have since made it 30 day trial only.

so that got me looking for alternatives,
imagemagick was one but the text was overflowing.
could'nt figure out how to get it to wrap or scale.

in reveal js, under examples/layouthelpers.html
to get text to fit you give it the class "r-fit-text".
each slide is inside a section tag
and you would write it just like regular html

ive got my darkreader extension on so i dont need to mess with section data-background="#00ffff" to style the background color

Tuesday, February 20, 2024

rss to html

convert a feed to html
gives access to the classes for styling too! embedding a blog into a site is a cool way to have a dynamic list of links that auto update
https://rss.bloople.net

color picker webtool

many other useful tools on this site
pinetools

Saturday, February 17, 2024

copying a range of lines from terminal

 previously posted a way

which involved opening it in vim.

This uses sed instead.

    

    sed -n '246,$p' filename.txt | pbcopy

this copys from line 246 to the end of the file 

Wednesday, February 14, 2024

how to copy a range of lines

let's say youve got an epub of some book
you use calibre to convert it to .txt
so you can practise typing a chapter of it.
you can skim through the toc

  • use / to search for chapter headings
  • or you can visual selct a a word with viw
    then use * and # to nav to next and prev instance

to copy a range to system clipboard:
:1,10y +
this copies line 1 to line 10 to the "+y system clipboard


  • you could also use :grep or :vimgrep but im not going to get into it this time
  • gf = go to file
  • gd = go to definition
  • ctrl [ on visual selection is the same as gd?

multiline comments in vim 2 ways


the other way is to visual select and :norm i#


Monday, February 12, 2024

3 sick vim plugins for dealing w tabular data


Plug 'dhruvasagar/vim-table-mode'
Plug 'godlygeek/tabular'
Plug 'mechatroner/rainbow_csv'

vimwiki is ok for tables too 
in vimwiki type :VimwikiTable 2 5
(this creates a 2 col 5 row empty table)
move through it with tab and shift tab
and it also auto formats.

item   = 1
flavour        = 2
pistachio              = 3

| align delimiters  | :Tabularize /= |
	* !important note that its not :Tableize 
	* that's table mode, tabularize is for tabular
	
| insert col        | leader tic   |
| delete row        | leader tdd   |
| enable table mode | leader tm    |
| delete column     | leader tdc   |
| add formula       | leader tfa   |
| evaluate formula  | leader tfe   |
| tableize a csv    | leader tt    |

| item      | price |
| hamburger | 1$    |
| hotdog    | 3$    |
|-----------+-------|
| TOTAL     | 4.0   |
/* tmf: $4,2=Sum(1:-1) */

leader tm     = table mode enable
shift v       = visual mode select everything
leader tt     = tablelize a csv
leader tfa    = enter formula Sum(1:-1)
leader tfe    = re-evaluate/re-align table
:Tabularize / = aligns by delimiter

	// and going the oposite way
https://tableconvert.com/markdown-to-csv

(also pretty handy too... 
Plug 'matze/vim-move')
	remapped it from ctrl + jk to shift + jk with ..
" Remap vim-move from alt to shift
let g:move_key_modifier_visualmode = 'S'

organice keyboard shortcuts


- next prev header  = ctrl up / down

- toggle open header = tab

- toggle todo states = alt t

- edit title = ctrl h

- edit desc = ctrl d

- exit edit = alt enter

- add header = ctrl enter

- del header = backspace 

- move header = alt up/down

- demote/promote header = alt shift left/right

- undo ctrl = /

Sunday, February 11, 2024

typing keys in fl

seeing those posters in music shops with the fretboard layed out with dots to guide your fingers to play all the scales.
too lazy to plug in my midi keyboard.
actually no, i prefer this mechanical keyboard
it feels so nice.
inspired by watching accordion players play cajun music.
shredding with those buttons.
typing keys
in c youve got 3 octaves to play with in c
you want that range in the other keys? too bad..
naw actually its not a big deal just transpose that midi clip around. (if you cant make music with 3 octave range thats a you problem )
remember those shitty plastic flutes from grade 4?
I remember thinking they were stupid because they were monophonic and had 1 octave range.
but when you see somebody throw down on a flute it makes you think twice.

also inspired by these guys...

Tuesday, February 6, 2024

male vocal ranges

male voices on the piano:

  1. Bass (Bass F Clef)

    • E2 to E4
  2. Baritone (Baritone F Clef)

    • A2 to A4
  3. Tenor (Treble Clef)

    • C3 to C5
  4. Countertenor (Treble Clef)

    • G3 to G5
  5. Contratenor (Treble Clef)

    • D3 to D5

Sunday, February 4, 2024

ios reading list key commands

reading list is cool if you want to do it like my previous method.
but thats not even neccesary on an ipad w a bluetooth keyboard w vim binds on the browser. just yy cmd shift to textastic comma and type the title. easier way to make the csv for the website links

safari on ipad

  • ctrl cmd 2 = show reading list sidebar
  • ctrl cmd d = add to reading list
  • ctrl cmd 1 = bookmarks sidebar
  • ctrl cmd 3 = history sidebar

vim-like extension

  • yy to copy link

Friday, February 2, 2024

regex to swap 2 columns of a csv

cliptools new update with smartfiles is amazing.
Ive got cliptools running 2 buffers deep.
enabled global paste in settings for cmd shift c to paste from smart file. my smartfile is {clip:1},{clip:2}(then newline).
I use this to quickly grab urls and titles to create links for my website.
my website runs a bunch of javascript that dynamically generates tables with links inside them from the csv.
By using cliptools I can grab all the links at once and as long as I stay consistant with copying the title,then the link its fine. if they end up backwards, it's not a big deal. Being consistent is the most important because I can easily use a regex to fix it.

my regex to fix it

:%s/\v([^,]+),([^,]+)/\2,\1/g