Skip to content

Instantly share code, notes, and snippets.

cwd=`pwd`;cd /usr/local; curl -s https://nodejs.org/dist/v16.13.2/node-v16.13.2-linux-x64.tar.gz | sudo tar --strip-components 1 -xz && cd "$cwd"
@paulochf
paulochf / ipython_notebook_large_width.py
Last active September 22, 2022 22:22
IPython/Jupyter Notebook enlarge/change cell width
from IPython.display import display, HTML
display(HTML(data="""
<style>
div#notebook-container { width: 95%; }
div#menubar-container { width: 65%; }
div#maintoolbar-container { width: 99%; }
</style>
"""))
@sparkida
sparkida / vimForceUnixFormat
Last active March 29, 2018 10:32
First, find all files in current directory with the extension ".php" and remove all "^M" ^M = Ctrl+V + Ctrl+M (don't just type the caret "^" symbol and M...they are not the same :/ )
#!/bin/bash
#Find and replace all files with ^M (dos format) to Unix format.
find $(pwd) -type f -name "*.php" | while read file; do sed -e 's/^M//g' -i "$file"; done;
@sparkida
sparkida / textLocator
Last active December 30, 2015 03:59
First find all files of type ".rb" in current directory, then search each file for "config" and display matched files
#!/bin/bash
#Find matching text in all files
find . -type f -name "*.rb" | while read file; do found=$(sed -n 's/config//p' "$file"); if [ ! -z "$found" ]; then echo "$file"; fi; done;