Skip to content

Instantly share code, notes, and snippets.

@kevana
Created October 6, 2015 17:02
Show Gist options
  • Save kevana/4a2261dddff934e85bc7 to your computer and use it in GitHub Desktop.
Save kevana/4a2261dddff934e85bc7 to your computer and use it in GitHub Desktop.
# Case 1: If user is going to credit app from desktop prevent them from being redirected
# - User has cookie set
# - url is in active list.
# THEN prevent moovweb redirect
# Case 2: User is already on moovweb and goes to credit app page
# - Via header is set
# - User has cookie set
# - url is in active list
# Issues: no short circuit evaluation,
# AND
set compoundcond 1;
if (!cond1) {
set compoundcond 0;
}
if (!cond2) {
set compoundcond 0;
}
if (compoundcond) { # equivalent to if (cond1 && cond2)
do something useful
}
# OR
set compoundcond 0;
if (cond1) {
set compoundcond 1;
}
if (cond2) {
set compoundcond 1;
}
if (compoundcond) { # equivalent to if (cond1 || cond2)
do something useful
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment