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
CREATE OR REPLACE FUNCTION empty(TEXT) | |
RETURNS bool AS | |
$$ SELECT $1 ~ '^[[:space:]]*$'; $$ | |
LANGUAGE sql | |
IMMUTABLE; | |
COMMENT ON FUNCTION empty(TEXT) | |
IS 'Find empty strings or strings containing only whitespace'; |
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
CREATE TABLE example ( | |
field TEXT | |
NOT NULL | |
CHECK ( NOT empty( field )) | |
); |
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 | |
# see my whole file @ http://github.com/xenoterracide/dot_etc/blob/master/bashrc | |
# set a good defaults if we aren't using konsole | |
export PS1='\[\033[01;32m\]\h\[\033[01;34m\] \W $ \[\033[00m\]' | |
umask 0077 | |
# set up env based on KONSOLE_PROFILE and KONSOLE_SESSION | |
# Test to see if the KONSOLE_PROFILE is empty |
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/env perl | |
# guess a number game | |
use feature 'say'; | |
use strict; | |
use warnings; | |
say "welcome"; | |
say "Guess the number: "; | |
my $guess = readline(*STDIN); |
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/env perl | |
# guess a number game | |
use feature 'say'; | |
use strict; | |
use warnings; | |
say "welcome"; | |
say "Guess the number: "; | |
my $guess = readline(*STDIN); |
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/env perl | |
# guess a number game | |
use feature 'say'; | |
use strict; | |
use warnings; | |
say "welcome"; | |
my $guess = 0; | |
until ( $guess == 5 ) { |
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/env perl | |
# guess a number game | |
use feature 'say'; | |
use strict; | |
use warnings; | |
say "welcome"; | |
my $winning_num = 5; |
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/env perl | |
# guess a number game | |
use feature 'say'; | |
use strict; | |
use warnings; | |
say "welcome"; | |
# generate the winning number between 1 and 10 | |
my $winning_num = int( rand(10) ); |
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/env perl | |
# guess a number game | |
use feature 'say'; | |
use strict; | |
use warnings; | |
say "welcome"; | |
# generate the winning number between 1 and 10 | |
# see perlfaq4 for algorithm details |
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/env perl | |
# guess a number game | |
use feature 'say'; | |
use feature 'switch'; | |
use strict; | |
use warnings; | |
say "welcome"; | |
# generate the winning number between 1 and 10 |
OlderNewer