Skip to content

Instantly share code, notes, and snippets.

@lambdamusic
lambdamusic / bard-input-test.md
Last active November 28, 2023 20:24
bard input test
@lambdamusic
lambdamusic / 2023-07-04-notes-deep-work-the-book.md
Last active November 22, 2023 08:50
notes-deep-work-2016

Notes from Deep Work by Cal Newport

A very biased collection of quotes and ideas from the book Deep Work by Cal Newport (2016).

Concept map

flowchart LR
    A((Deep Work)) -->|Versus| B(Shallow Work)
    B --> B1[Shallow work promotes more shallow work]
@lambdamusic
lambdamusic / quote.md
Last active January 23, 2023 08:05
test-quote

template: quote.html title: "Additive manufacturing" source: "A Third Industrial Revolution | The Economist" url: http://www.economist.com/node/21552901 date: 2013-02-26 modified: 2015-05-04 review: false

@lambdamusic
lambdamusic / wdatebash
Last active October 12, 2021 10:00
World date from the terminal
#!/bin/bash
wdate () {
search=$1;
zoneinfo=/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pytz/zoneinfo/;
format='%a %F %T';
find -L $zoneinfo -type f \
@lambdamusic
lambdamusic / researchers.sql
Last active April 4, 2024 22:00
GBQ Dimensions: Getting researchers based on two criteria #sql
-- Pub criteria:
-- FOR code
-- Specific journals
-- Year
-- Author criteria:
-- FCR (of any paper for last 5 years) > 1.5
-- Last publication < 24 months ago
-- Total publications > 7
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lambdamusic
lambdamusic / arrays.sql
Last active April 4, 2024 21:57
GBQ Arrays examples with Dimensions #sql
-- example 1
-- unnest an array in line so to perform an aggregation
select
id,
(SELECT MAX(e) from UNNEST(email) e) as first_email
from `dimensions-ai.data_analytics.researchers` r
WHERE ARRAY_LENGTH(email) > 0
LIMIT 10
@lambdamusic
lambdamusic / researchers1.sql
Last active April 4, 2024 22:01
GBQ Dimensions: return researchers and their publication count #sql
-- Return researchers and their publication count
-- LIMITED TO
-- publications with FOR “11 Medical and Health Sciences”
-- WHERE
-- Researcher is from Canada, Austria, Belgium, Czech Rep, Denmark, Finland, France, Australia
-- Researcher did NOT publish in the 2018, 2019, 2020 in a journal from publisher “Public Library of Science (PLoS)”
-- Researcher has email address
-- number of publications is minimum 3
-- sorted by
-- publication count
@lambdamusic
lambdamusic / covid19-tutorial-1.sql
Last active April 4, 2024 21:59
GBQ COVID-19 dataset sample query #sql
SELECT
p.id,
p.title.preferred AS title,
p.doi,
p.year,
p.journal.title,
p.type,
p.date AS date_publication,
p.date_inserted,
FROM
@lambdamusic
lambdamusic / python_request_create_gist.py
Last active April 11, 2021 20:19 — forked from joshisumit/python_request_create_gist.py
Create GIST from your python code with python requests module and OAuth token.
'''
HTTP Reuests has following parameters:
1)Request URL
2)Header Fields
3)Parameter
4)Request body
PREREQUISITE
* head over to https://github.com/settings/tokens and generate a new token with 'gists' permissions