Write KFC with one-line-script using the string “Kentucky Fried Chicken” once.
for w in $(echo "Kentucky Fried Chicken" | tr " " "\n"); do echo -n ${w:0:1}; done;I forked a repo dzen/omgcats a couple weeks ago on duboisnicolas/omgcats. I missed some commits so I need to resynchronize dzen/omgcats on duboisnicolas/omgcats.
$ git clone git://github.com/duboisnicolas/omgcats.git
$ cd omgcats
# New branch for latest commits:
$ git checkout -b upstream/master
# Add new remote upstream from original repo:| # make sure there's no TODO, debugging... left | |
| errors=0 | |
| for bad in 'import pdb' 'import ipdb' 'TODO' 'print' 'assert False'; do | |
| echo ">> checking for '$bad'" | |
| res=$(git diff-index --name-only --cached $against -S"$bad" --) | |
| if test -n "$res"; then # if not empty, found some guilty files | |
| echo "ERROR, found '$bad' in files commited:" | |
| echo $res | |
| errors=$(($errors + 1)) | |
| fi |
Math trick: works with any number
(Source: https://twitter.com/Perspective_pic/status/399718664540520448)
| # -*- coding: utf-8 -*- | |
| from random import choice | |
| import sys | |
| from webbrowser import open_new as please_help_me | |
| def switch_to(app): | |
| print('⌘ + ⇥ to ' + app.title()) |