Skip to content

Instantly share code, notes, and snippets.

@jolle-c
Last active August 29, 2015 14:07
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/7cfb53fa49da66d82df9 to your computer and use it in GitHub Desktop.
Save jolle-c/7cfb53fa49da66d82df9 to your computer and use it in GitHub Desktop.
Method to check if client_ip matches any of the strings in a provided staticarray
[
/**!
client_ip_isin
Will return true if client_ip matches any of the strings in the provided staticarray
Examples
client_ip_isin((: '127.*', '90.229.223.*'))
2014-10-08 JC Added to Gist
2014-09-10 JC First version
*/
define client_ip_isin(check::staticarray) => {
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