Skip to content

Instantly share code, notes, and snippets.

View cazyw's full-sized avatar

Carol W cazyw

View GitHub Profile
@cazyw
cazyw / settings.txt
Created October 9, 2019 12:17
terminal settings
git config --global core.pager cat
~/.bash_profile
=======================
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]' # set window title
PS1="$PS1"'\n' # new line
PS1="$PS1"'\[\033[32m\]' # change to green
PS1="$PS1"'\u@\h ' # user@host<space>
@cazyw
cazyw / gist:b7056ec84c9cc07ccdcf117f51a3dbef
Last active November 29, 2017 11:06
Code Tips and Setup for Windows Environments
Git Bash for Windows
========================
Release notes: C:/Program%20Files/Git/ReleaseNotes.html
Some console programs, most notably non-MSYS2 Python, PHP, Node and OpenSSL, interact correctly with MinTTY only when called through winpty (e.g. the Python console needs to be started as winpty python instead of just python).
This is true for running ruby files that require stdin.
Use:
e.g. $ winpty ruby ./lib/toy_robot_sim.rb
-------------------------
@cazyw
cazyw / gist:0567789ec00a00a68b792f8953379bb3
Last active April 8, 2016 23:59
Python Exercises http://www.practicepython.org/ - Exercise 28 - Max of Three
# Python Exercises http://www.practicepython.org/
# Exercise 28 - Max of Three
# Exercise to return the largest of three numbers
# Last updated: 09/04/2016
# Using PYTHON 3
def max_of_three(one, two, three):
if one >= two:
if one >= three:
return one
@cazyw
cazyw / gist:c2f8d6b4934b2e414055
Last active March 18, 2016 02:24
Python Exercises http://www.practicepython.org/ - Exercise 27 - Tic Tac Toe Draw
# Python Exercises http://www.practicepython.org/
# Exercise 27 - Tic Tac Toe Draw
# Exercise to draw Tic Tac Toe gameboard the game board getting input from Player 1 and Player 2
# Last updated: 17/02/2016
#
# - gets input from two players
# - checks the input for correctness: row,col
# - exits if board is full or there is a winner