command | description |
---|---|
ctrl + a | Goto BEGINNING of command line |
This file contains hidden or 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
# 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" |
This file contains hidden or 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
:: 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" |
This file contains hidden or 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 pytz | |
>>> | |
>>> for tz in pytz.all_timezones: | |
... print tz | |
... | |
... | |
Africa/Abidjan | |
Africa/Accra | |
Africa/Addis_Ababa | |
Africa/Algiers |
This file contains hidden or 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 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> | |
""")) |
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
This file contains hidden or 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 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 |
People
![]() :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: |
This file contains hidden or 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
# 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" |