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
#simple class | |
class Person | |
end | |
#inheritance | |
class Sarah < Person | |
end | |
#class with constructor arguments | |
class Jet |
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
#color and git branch | |
parse_git_branch() {·· | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
export CLICOLOR=1 | |
export GREP_OPTIONS="--color" | |
export LSCOLORS=gxfxcxdxbxegedabagacad | |
PS1='\n\[\e[1;36m\]\w \[\e[m\]\[\e[1;33m\]$(parse_git_branch)\[\e[m\] \n> ' |
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
PS1="\n\[\033[32;1m\]It's \t\[\033[33;1m\] Currently browsing \[\033[1;36m\]\w \[\033[33;1m\]directory\n\[\033[34;1m\]\ `if [ \$? = 0 ]; then echo \[\e[37m\]Last Command Was Successfully Executed \[\e[32m\]^_^\[\e[0m\]; else echo \[\e[37m\ ]Smeggin Hell exit! Last Command Was Unknown \[\e[32m\]O_O\[\e[0m\]; fi\` \n\[\033[31m\]What is thy bidding, my master? \n\n\[\033[34;1m\]" | |
The above seems to work on Ubuntu. On CentOS I use the following subset of the above: | |
PS1="\n\[\033[32;1m\]It's \t\[\033[34;1m\] Current Directory: \[\033[1;36m\]\w \[\033[33;1m\] \n\[\033[31m\]What is thy bidding, my master? \n\[\033[36;1m\]> " | |
This produces the following output: | |
It's 08:32:32 Current Directory: ~ |
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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use File::Basename; | |
use WWW::Mechanize; | |
my $mech = WWW::Mechanize->new(); |
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
# I wrote this code at one of my jobs because the databases that we had for our customers had issues. | |
# It ended up that the csv files that were being produced did not have correct values in the | |
# corresponding fields. This generally happened when people added fields in the middle of the schema | |
# file, instead of at the end like they should have. This code was run on databases that, at the | |
# time, were as large as 1.5 terabytes. The function would spit out the differences between the schema and the actual defined table definitions and it was then my job to make the modifications on the fly to the live tables to correct the issues. Sometimes I simply modified the code that was used | |
# to populate the csv files as it seemed a bit easier, but most of the mods had to be to the database | |
# table definitions themselves. Hair raising for a 1.5 terabyte database, let me just say. | |
# I wrote this function, which was added to a larger file containing a bunch of handy functions, and | |
# when run, compared the databas |
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
##################################################################################### | |
# This code takes a config file that contains a single line of data that has all of | |
# the needed values separated by a pipe (|) character and parses each line | |
# into an array. Then, each element of the array is assigned to its respective key | |
# in the hash. | |
# | |
# Here is an example of what the config file should look like: | |
# | |
# /export/home/partd001/|subconnector|rck6701ftps02.bcbsmamd.net|sbsbprod|ty5jk3h | |
# |
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
# This prints out a list of all the installed Perl modules on the system and the version of each one | |
# that is currently installed | |
use strict; | |
use warnings; | |
use ExtUtils::Installed; | |
my $instmod = ExtUtils::Installed->new(); | |
foreach my $module ($instmod->modules()) { | |
my $version = $instmod->version($module) || "???"; |
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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
######################################################################### | |
# Script: characters.pl | |
# Author: Jefferson Kirkland | |
# Date: December 11, 2007 | |
# |
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
################################################################################# | |
# Script: nuum2name.pl | |
# Author: Jefferson Kirkland | |
# Company: JK Web Development | |
# Copyright: 2008 | |
# | |
# Description: This script takes a list of numbers, supplied by the user, and | |
# converts the numbers into names. The script then prints them out to show the | |
# user what names the numbers corresponded to. | |
# |
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
I actually found this on a college programming course site. Its a list of ideas for the class to draw from for project ideas. | |
###################################################################3 | |
Ideas for the class project | |
Here are some rough notes that may be useful for deciding on a topic for the class project. You should treat the following as starting points for further discussion and development, not as canned project suggestions (which you can find elsewhere). In particular, the following are not intended to serve as replacements for discussing project ideas and plans (among project team members and with the instructor and TA). | |
Note that some of these are too simple for a project and others may be too complex. Treat the following merely as a collection of ideas from which you can pick some you like, combining them to get a project that both interests you and is sufficiently challenging from a technical viewpoint. You are encouraged to stop by during office hours to discuss any of the following that |
OlderNewer