This file contains 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 | |
# Here are some embedded Python examples using Python3. | |
# They are put into functions for separation and clarity. | |
# Simple usage, only using python to print the date. | |
# This is not really a good example, because the `date` | |
# command works just as well. | |
function date_time { |
This file contains 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
""" | |
Basic IRC bot using Twisted. | |
Code is by habnabit, and comes from https://gist.github.com/habnabit/5823693 | |
""" | |
import sys | |
from twisted.internet import defer, endpoints, protocol, reactor, task | |
from twisted.python import log | |
from twisted.words.protocols import irc |
This file contains 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
# BASH function (As of 08/13/14 this no longer works (they finally change the layout of the page.) | |
# It is kept here as a reference, in case someone wants to make a different version. | |
# ..mine is in Python now :) | |
function define() { | |
if [ "${1}" = "" ] ; then | |
echo "Usage: define dog" | |
else | |
lynx -dump -nonumbers -width=160 "http://dictionary.reference.com/browse/${1}" | grep -A15 "World English Dictionary" | |
fi | |
} |
This file contains 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
# BASH function | |
function spanish() { | |
if [ "${1}" = "" ] ; then | |
# usage: spanish [english word] | |
echo "Usage: spanish dog" | |
else | |
lynx -dump -nonumbers -width=160 "http://spanish.dictionary.com/definition/${1}?src=en" | grep "${1} / " | |
fi | |
} |
This file contains 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
# BASH function | |
function weather() { | |
if [ "${1}" = "" ] ; then | |
# echo "Usage: weather 90210" | |
lynx -dump -nonumbers -width=160 "http://weather.unisys.com/forecast.php?Name=90210" | grep -A13 'Latest Observation' | |
else | |
lynx -dump -nonumbers -width=160 "http://weather.unisys.com/forecast.php?Name=${1}" | grep -A13 'Latest Observation' | |
fi | |
} |