Skip to content

Instantly share code, notes, and snippets.

@jolle-c
Created February 3, 2016 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jolle-c/29bb9e8a0dff718de930 to your computer and use it in GitHub Desktop.
Save jolle-c/29bb9e8a0dff718de930 to your computer and use it in GitHub Desktop.
Lasso 9 method to check if a range of IP numbers match the current client ip
/**!
client_ip_isin
Will return true if client_ip matches any of the strings in the provided staticarray
Examples
client_ip_isin((: '127.*', '94.219.224.*'))
2014-09-10 JC First version
*/
define client_ip_isin(check::staticarray) => {
with item in #check do {
client_ip == #item ? return true
}
return false
}
define client_ip_isin(check::array) => {
with item in #check do {
client_ip == #item ? return true
}
return false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment