Skip to content

Instantly share code, notes, and snippets.

View daniloimparato's full-sized avatar
💭
😎

Danilo Imparato daniloimparato

💭
😎
View GitHub Profile
@daniloimparato
daniloimparato / prune_json_tree.sh
Last active October 5, 2022 18:21
Prune JSON tree by leaf attribute with jq
# https://jqplay.org/s/r8OFxRIDzvs
# Also works:
# jq 'delpaths( [ path( .. | select( .desired_attribute? == false and (.children | length) == 0 ) ) ] )'
cat <<EOF | jq 'del( .. | select( .desired_attribute? == false and (.children | length) == 0 ) )'
{
"name": "father",
"desired_attribute": false,
"children": [
@daniloimparato
daniloimparato / read_files.R
Last active November 13, 2022 18:48
tidyverse load multiple files into one data frame
file_paths <- list.files("files_dir", "*.tsv", recursive = T) %>% set_names(.,.)
df <- map_df(file_paths, read_tsv, .id = "path")
@daniloimparato
daniloimparato / chaos_custom.rstheme
Created April 16, 2020 15:44
Custom changes to RStudio Chaos theme
/* rs-theme-name: Chaos Custom */
/* rs-theme-is-dark: TRUE */
.ace_gutter {
background: #141414;
color: #595959;
border-right: 1px solid #282828;
}
.ace_gutter-cell.ace_warning {
background-image: none;
background: #FC0;
@daniloimparato
daniloimparato / index.html
Last active June 16, 2019 22:09
portable hls-player copied from gramk/chrome-hls
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script>/*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a
@daniloimparato
daniloimparato / settings.json
Last active May 26, 2019 00:03
VSCode settings (Fira Code + italics)
{
"telemetry.enableTelemetry": false,
"telemetry.enableCrashReporter": false,
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\wsl.exe",
// "terminal.integrated.shellArgs.linux": ["-l"],
"terminal.integrated.fontFamily": "DejaVu Sans Mono for Powerline",
"terminal.integrated.fontWeight": "500",
"terminal.integrated.fontSize": 14,
"editor.fontFamily": "'Fira Code', 'Courier New', monospace",
"editor.fontWeight": "400",
@daniloimparato
daniloimparato / index.html
Last active August 12, 2018 04:44
D3.js SVG Arecibo Message
<!DOCTYPE html>
<html>
<head>
<title>D3.js SVG Arecibo Message</title>
<style>
html, body, #outer {
height: 100%;
margin: 0;
}
#outer {