This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# see https://forum.obsidian.md/t/gnome-desktop-installer/499 | |
set -euo pipefail | |
icon_url="https://cdn.discordapp.com/icons/686053708261228577/1361e62fed2fee55c7885103c864e2a8.png" | |
#dl_url=${1:-} | |
dl_url=$( curl -s https://api.github.com/repos/obsidianmd/obsidian-releases/releases/latest \ | |
| grep "browser_download_url.*AppImage" | tail -n 1 | cut -d '"' -f 4 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[snippets]] | |
description = "edit pet configs and snippets" | |
command = "code ~/.config/pet/snippet.toml" | |
tag = ["pet"] | |
output = "" | |
[[snippets]] | |
description = "edit snippets_menu jupyter plugin configuration" | |
command = "code ~/.local/share/jupyter/nbextensions/snippets_menu/my_snippets.js" | |
tag = ["python", "jupyter"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%https://www.mathworks.com/matlabcentral/newsreader/view_thread/243177 | |
clear all | |
clc | |
figure(1);clf | |
%y=[ 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1]; % spike train | |
SPIKE_TRAIN_LENGTH = 100; | |
y=double(logical(rand(SPIKE_TRAIN_LENGTH,1)<0.5)); | |
plot(y) | |
hold on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# see https://stackoverflow.com/a/46597567/1640414 | |
echo "started" | |
function a() { | |
# do some stuff here | |
echo "a()" | |
ls *.sh | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# A script with functions to add to .bashrc | |
# Uploads a file or a zipped directory to `keep.sh` | |
# see https://free.keep.sh | |
# usage: transfer hello.txt | |
# requirements: curl | |
# based on transfer.sh old, not-working anymore script. | |
# A free bucket is provided by keep.sh for public use. Files are limited to 500MB and are deleted 24 hours after upload. | |
transfer() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MY_SNIPPETS = { | |
'name': 'Snippets', | |
'sub-menu': [ | |
{ | |
'name': 'config file', | |
'snippet': ['!cat ~/.local/share/jupyter/nbextensions/snippets_menu/my_snippets.js'] | |
}, | |
'---', | |
{ | |
'name': 'Header', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# A script with functions to add to .bashrc | |
# Uploads a file to transfer.sh | |
# see https://transfer.sh/ | |
# usage: transfer hello.txt | |
# requirements: curl | |
transfer() { | |
if [ $# -eq 0 ]; then | |
echo "No arguments specified.\nUsage:\n transfer <file|directory>\n ... | transfer <file_name>" >&2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -s https://api.github.com/repos/sharkdp/bat/releases/latest \ | |
| grep "browser_download_url.*amd64.deb" \ | |
| grep "bat-musl_" \ | |
| cut -d : -f 2,3 \ | |
| tr -d \" \ | |
| wget -P "$TempFileDirectory" -qi - && | |
sudo dpkg -i bat-musl*_amd64.deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/a/37124230/1640414 | |
# https://caldwell.github.io/renderjson/ | |
import uuid | |
from IPython.display import display_javascript, display_html, display | |
import json | |
class RenderJSON(object): | |
def __init__(self, json_data): | |
if isinstance(json_data, dict): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
logging.basicConfig(level="DEBUG", style="{", | |
format='[{asctime:s}] {levelname:7s} | {process:5d} | {name:s} | {message:s}') | |
_logger = logging.getLogger(__name__) |
NewerOlder