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 | |
# from here: https://planet.jboss.org/post/opening_a_new_tab_in_an_existing_gnome_terminal_window | |
# Path: /usr/local/bin/gnome-terminal | |
if [ "x$*" != "x" ]; then # any args? | |
/usr/bin/gnome-terminal "$@" | |
exit 0 | |
fi | |
# first, inspect the current window |
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 | |
set -e | |
# Any subsequent(*) commands which fail will cause the shell script to exit immediately | |
input=$1 | |
#filename=$(basename -- "$fullfile") | |
#extension="${filename##*.}" | |
#filename="${filename%.*}" |
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
# https://superuser.com/a/1104214/362338 | |
for i in {0..255}; do printf "\x1b[38;5;${i}mcolor%-5i\x1b[0m" $i ; if ! (( ($i + 1 ) % 8 )); then echo ; fi ; done |
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://superuser.com/a/1104214/362338 | |
for i in {0..255}; do printf "\x1b[38;5;${i}mcolor%-5i\x1b[0m" $i ; if ! (( ($i + 1 ) % 8 )); then echo ; fi ; done |
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
Show hidden characters
{ | |
"indent_size": 4, | |
"indent_char": " ", | |
"indent_level": 0, | |
"indent_with_tabs": false, | |
"preserve_newlines": true, | |
"max_preserve_newlines": 10, | |
"jslint_happy": false, | |
"brace_style": "expand", | |
"keep_array_indentation": false, |
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
#from here: https://stackoverflow.com/a/49197110/1640414 | |
from contextlib import closing | |
from IPython.utils.io import Tee | |
print('This is not in the output file.') | |
with closing(Tee("/tmp/outputfile.log", "w", channel="stdout")) as outputstream: | |
print('This is written to the output file and the console.') |
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
from pprint import pformat | |
from pygments import highlight | |
from pygments.formatters.terminal256 import Terminal256Formatter | |
from pygments.lexers.python import PythonLexer | |
def pprint_color(obj): | |
print(highlight(pformat(obj), PythonLexer(), Terminal256Formatter())) |
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 time | |
from tqdm.auto import tqdm | |
class TqdmIntervalReport(tqdm): | |
""" | |
`tqdm` that updates only when an interval is reached | |
based on snippet from https://github.com/tqdm/tqdm |
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 | |
# From here: https://stackoverflow.com/a/29269913 | |
# by: https://stackoverflow.com/users/122422/b-t | |
# based on: https://stackoverflow.com/a/6874645/1640414 | |
# Usage: hfnano.sh yourHugeFile 3 8 | |
# hint: put in your /usr/bin | |
if [ "$#" -ne 3 ]; then | |
echo "Usage: $0 hugeFilePath startLine endLine" >&2 | |
exit 1 |