Skip to content

Instantly share code, notes, and snippets.

@you-zhou
you-zhou / ColourfulShell
Created March 23, 2018 01:00 — forked from ChrisMorrisOrg/ColourfulShell
Colourise and highlight text in your Python app when running through shell.
# Colourise - colours text in shell. Returns plain if colour doesn't exist.
def colourise(colour, text):
if colour == "black":
return "\033[1;30m" + str(text) + "\033[1;m"
if colour == "red":
return "\033[1;31m" + str(text) + "\033[1;m"
if colour == "green":
return "\033[1;32m" + str(text) + "\033[1;m"
if colour == "yellow":
return "\033[1;33m" + str(text) + "\033[1;m"
@ferventcoder
ferventcoder / NonAdmin.cmd
Last active February 23, 2025 08:49
Installing Software as a Non-Administrator Using Chocolatey
:: Pick one of these two files (cmd or ps1)
:: Set directory for installation - Chocolatey does not lock
:: down the directory if not the default
SET INSTALLDIR=c:\ProgramData\chocoportable
setx ChocolateyInstall %INSTALLDIR%
:: All install options - offline, proxy, etc at
:: https://chocolatey.org/install
@powershell -NoProfile -ExecutionPolicy Bypass -Command "(iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1" && SET PATH="%PATH%;%INSTALLDIR%\bin"
@heyalexej
heyalexej / pytz-time-zones.py
Created November 16, 2016 09:14
list of pytz time zones
>>> import pytz
>>>
>>> for tz in pytz.all_timezones:
... print tz
...
...
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
@paulochf
paulochf / ipython_notebook_large_width.py
Last active November 14, 2024 11:23
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>
"""))
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active May 18, 2025 02:41
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@bsweger
bsweger / useful_pandas_snippets.md
Last active April 4, 2025 21:20
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

@matheusho
matheusho / django_signals_slugify.py
Last active October 13, 2024 00:01
Django : Generate unique slug
# import signals and slugify
from django.db.models import signals
from django.template.defaultfilters import slugify
class Post(models.Model):
text = models.TextField("Post text")
# function for use in pre_save
@rxaviers
rxaviers / gist:7360908
Last active May 18, 2025 12:46
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@ChrisMorrisOrg
ChrisMorrisOrg / ColourfulShell
Last active January 15, 2024 03:09
Colourise and highlight text in your Python app when running through shell.
# Colourise - colours text in shell. Returns plain if colour doesn't exist.
def colourise(colour, text):
if colour == "black":
return "\033[1;30m" + str(text) + "\033[1;m"
if colour == "red":
return "\033[1;31m" + str(text) + "\033[1;m"
if colour == "green":
return "\033[1;32m" + str(text) + "\033[1;m"
if colour == "yellow":
return "\033[1;33m" + str(text) + "\033[1;m"