Skip to content

Instantly share code, notes, and snippets.

View ftuyama's full-sized avatar

Felipe Tuyama ftuyama

View GitHub Profile
(* Content-type: application/vnd.wolfram.mathematica *)
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 9.0' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
(* Content-type: application/vnd.wolfram.mathematica *)
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 9.0' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
@ftuyama
ftuyama / piano.md
Created July 28, 2023 03:44
Piano Sheet from Synthesia Video
@ftuyama
ftuyama / export_kibana.js
Created February 13, 2023 22:22
Export data from Kibana
let match;
const text = $(".dscWrapper").text();
const regex = /TL_[A-Z0-9]{6}/g;
const matches = [];
while ((match = regex.exec(text)) !== null) {
matches.push(match[0]);
}
function download(data, filename, type) {
@ftuyama
ftuyama / TotalSpaces3.restart.plist
Created February 5, 2023 16:42
Auto restart TotalSpaces3 in case of crash. Save it in ~/Library/LaunchAgents/
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>TotalSpaces3.restart</string>
@ftuyama
ftuyama / compare.rb
Created September 28, 2021 15:45
Recursively compare json objects
require 'json'
def flatten_hash(param, prefix=nil)
param.each_pair.reduce({}) do |a, (k, v)|
if v.is_a?(Array)
v = v.map.with_index { |x, i| [i, x] }.to_h
end
if v.is_a?(Hash)
a.merge(flatten_hash(v, "#{prefix}#{k}."))
@ftuyama
ftuyama / flatten.rb
Created September 28, 2021 15:37
Recursive flattening json object
def flatten_hash(param, prefix=nil)
param.each_pair.reduce({}) do |a, (k, v)|
if v.is_a?(Array)
v = v.map.with_index { |x, i| [i, x] }.to_h
end
if v.is_a?(Hash)
a.merge(flatten_hash(v, "#{prefix}#{k}."))
else
a.merge("#{prefix}#{k}".to_sym => v)
@ftuyama
ftuyama / vscode.css
Last active March 4, 2021 19:22
VSCode tab wrapping
/* Following CSS to wrap the tab-bar into multiple rows: */
.tabs-and-actions-container > .monaco-scrollable-element {
height: auto !important;
}
.tabs-and-actions-container > .monaco-scrollable-element > .tabs-container {
height: auto !important;
flex-wrap: wrap;
@ftuyama
ftuyama / workspace.sh
Created April 14, 2020 13:48
libinput-gestures workspace switch using 3 fingers
#!/bin/sh
# libinput-gestures workspace helper
# Then add the commands in Gesture interface
# Left
# /home/username/workspace.sh -1
# Right
# /home/username/workspace.sh 1
# Up
@ftuyama
ftuyama / macOS
Last active June 15, 2023 20:19
MacOS apps
hyperswitch
iCanHazShortcut
iterm2
zsh
TotalSpaces3
BetterTouchTool
TextSniper
Grammarly
atext