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 \
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
iterate a bucket in s3 containing JSON log files
get each file, massage json a little and uploade to elasticsearc
"""
@lambdamusic
lambdamusic / split_json.sh
Created February 27, 2019 11:37
Split jsonl file by line with 10000+ lines and rename files
#!/bin/bash
FILENAME=records_111901_00000000.jsonl
split -a 5 -l 1 $FILENAME temp
n=1
for f in temp*
do
cat $f >> Part${n}.json
rm $f
((n++))
done
@lambdamusic
lambdamusic / splitter.sh
Created September 24, 2018 19:29 — forked from maesa/splitter.sh
Bash script for splitting large CSV files while keeping the header into 100 lines a piece using Split. Outputs as Part1, Part2, ... while keeping its Header
#!/bin/bash
FILENAME=filename_here.csv
HDR=$(head -1 $FILENAME)
split -l 100 $FILENAME xyz
n=1
for f in xyz*
do
if [ $n -gt 1 ]; then
echo $HDR > Part${n}.csv
fi
@lambdamusic
lambdamusic / scigraph_context.json
Last active September 21, 2018 15:46
scigraph context (preview)
# source: https://github.com/springernature/scigraph/blob/master/2018Q3/context/scigraph.json
{
"@context": {
"@vocab": "http://schema.org/",
"@base": null,
"sg": "http://scigraph.springernature.com/id/",
"sgo": "http://scigraph.springernature.com/ontologies/core/",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",