Skip to content

Instantly share code, notes, and snippets.

Avatar

George Mauer togakangaroo

View GitHub Profile
View how shell startup scripts work.md

Login shell

Whenever bash/zsh/etc was launched with the --login flag or by the systemd/init process determines whether it is a “login shell” (although because there’s two ways to create this, figuring out if you are in a login shell isn’t 100%.

These will run the first readable profile script they encounter. The specific shell determines where it looks but for (some versions) of bash for example the order is .bash_profile, .bash_login, .profile. This varies by version a bit but isn’t too terribly hard to guess. Also there are logout scripts that will run on shell exit (their names are similar but not completely homoiconic). All this can be disabled with --noprofile

Interactive non-login shell

When launched with -i (which is not short for --interactive but instead a shopt thing) or I believe via just bash/zsh without the -c parameter, This is again not straightforward to test for whether you’re interactive or not. Online people say to check for echo $- containing an i but I

View lsp-js fail log
0 verbose cli [
0 verbose cli '/home/gmauer/.nvm/versions/node/v15.5.1/bin/node',
0 verbose cli '/home/gmauer/.nvm/versions/node/v15.5.1/bin/npm',
0 verbose cli '-g',
0 verbose cli '--prefix',
0 verbose cli '/home/gmauer/.emacs.d/.cache/lsp/npm/vscode-json-languageserver',
0 verbose cli 'install',
0 verbose cli 'vscode-json-languageserver'
0 verbose cli ]
1 info using npm@7.3.0
View notes.org

Covid19 County-Level Deaths

Set this variable to your county name

"Orleans"

No need to run this block, its just pulling data from the nytimes covid-19 tracking csv and filtering it to that of your county. If you’re not in Louisiana, change it to your state.

View notes.org

Covid19 Orleans Deaths

"Orleans"
curl https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-counties.csv | 
 grep "$COUNTY,.*Louisiana"
View notes.org

Covid19 Orleans Deaths

curl https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-counties.csv | 
 grep "Orleans.*Louisiana"
View notes.org

Covid19 Orleans Deaths

curl 'https://dev.datacenterresearch.org/covid-19/outputs/New%20Orleans%20confirmed%20cases%20and%20deaths.csv' -H 'Connection: keep-alive' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' -H 'Origin: https://www.datacenterresearch.org' -H 'Sec-Fetch-Dest: empty' -H 'User-Agent: Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Mobile Safari/537.36' -H 'Accept: */*' -H 'Sec-Fetch-Site: same-site' -H 'Sec-Fetch-Mode: cors' -H 'Referer: https://www.datacenterresearch.org/covid-19-data-and-information/covid-19-data/' -H 'Accept-Language: en-US,en;q=0.9' --compressed
View notes.org

Covid19 Orleans Deaths

curl 'https://dev.datacenterresearch.org/covid-19/outputs/New%20Orleans%20confirmed%20cases%20and%20deaths.csv' -H 'Connection: keep-alive' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' -H 'Origin: https://www.datacenterresearch.org' -H 'Sec-Fetch-Dest: empty' -H 'User-Agent: Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Mobile Safari/537.36' -H 'Accept: */*' -H 'Sec-Fetch-Site: same-site' -H 'Sec-Fetch-Mode: cors' -H 'Referer: https://www.datacenterresearch.org/covid-19-data-and-information/covid-19-data/' -H 'Accept-Language: en-US,en;q=0.9' --compressed
View foo.md

Sum elements to next in a list

Question:

I have to create a function that sums of every 2 consecutives elements ina lst. for example ([2,4,3,1,-2]). the output expected [6,7,4,-1]

The basic idea is to take the collection

View foo.md

Table of Contents

The basic idea is to take the collection

View is-it-hoisting.html
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2020-02-06 Thu 17:15 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>&lrm;</title>
<meta name="generator" content="Org mode" />