Moved to https://github.com/kbilsted/Functional-core-imperative-shell/blob/master/README.md
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
#!/bin/bash | |
# This script assumes you're using the directory layout described in the | |
# documentation at: https://voc.readthedocs.io/en/latest/tutorials/tutorial-0.html | |
set -e | |
set -x | |
abort() { | |
echo "$*"; exit 1; | |
} |
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 urwid | |
class SelectableText(urwid.Text): | |
def selectable(self): | |
return True | |
def keypress(self, size, key): | |
return key | |
content = urwid.SimpleListWalker([ |
In Terminal
mkdir ~/.bash
Copy the raw git-prompt.sh
file from git contrib in to the ~/.bash
directory: https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh
Inside ~/.bashrc
or ~/.bash_profile
(choose the file where you normally put any bash customizations/setup), add the lines:
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 modules | |
import random | |
import datetime | |
# create function accepting a single parameter, the year as a four digit number | |
def get_random_date(year): | |
# try to get a date | |
try: | |
return datetime.datetime.strptime('{} {}'.format(random.randint(1, 366), year), '%j %Y') |
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 os | |
import signal | |
from gi.repository import Gtk as gtk | |
from gi.repository import AppIndicator3 as appindicator | |
APPINDICATOR_ID = 'myappindicator' | |
def main(): | |
indicator = appindicator.Indicator.new(APPINDICATOR_ID, os.path.abspath('sample_icon.svg'), appindicator.IndicatorCategory.SYSTEM_SERVICES) | |
indicator.set_status(appindicator.IndicatorStatus.ACTIVE) |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import subprocess | |
import time | |
VERBOSE = False | |
def wait(seconds): |
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 lxml import etree | |
CLASS_EXPR = "contains(concat(' ', normalize-space(@class), ' '), ' {} ')" | |
def has_class(context, *classes): | |
""" | |
This lxml extension allows to select by CSS class more easily |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!