Skip to content

Instantly share code, notes, and snippets.

@nickolasburr
nickolasburr / in_array.c
Created August 5, 2017 17:40
Check if a string exists in an array.
#include <string.h>
/**
* Check if a string exists in an array.
*/
int in_array (const char* const str, const char *arr[], size_t size) {
int i;
for (i = 0; i < size; i += 1) {
if (!strcmp(arr[i], str)) {
@nickolasburr
nickolasburr / extract
Last active December 1, 2017 03:15
Extract various archive types.
#!/usr/bin/env bash
###
### extract: Utility for extracting various archive types.
###
shopt -s extglob
USAGE="Usage: extract FILE [FILE] ..."
@nickolasburr
nickolasburr / prsg
Created December 1, 2017 20:46
Generate pseudo-random string of n characters.
#!/usr/bin/env bash
###
### prsg: Generate pseudo-random string of n characters.
###
if [[ $# -eq 0 ]]; then
printf 'Usage: prsg LENGTH\n'
exit 1
@nickolasburr
nickolasburr / alphanum
Created December 1, 2017 21:23
Generate pseudo-random alphanumeric string of n characters.
#!/usr/bin/env bash
###
### alphanum: Generate pseudo-random alphanumeric string of n characters.
###
LC_CTYPE=C tr -dc A-Za-z0-9 < /dev/urandom | head -c $1 | xargs ;
diff --git a/ext/intl/breakiterator/codepointiterator_internal.cpp b/ext/intl/breakiterator/codepointiterator_internal.cpp
index 723cfd5022..f6f75d2731 100644
--- a/ext/intl/breakiterator/codepointiterator_internal.cpp
+++ b/ext/intl/breakiterator/codepointiterator_internal.cpp
@@ -74,7 +74,11 @@ CodePointBreakIterator::~CodePointBreakIterator()
clearCurrentCharIter();
}
+#if U_ICU_VERSION_MAJOR_NUM >= 70
+bool CodePointBreakIterator::operator==(const BreakIterator& that) const
diff --git a/ext/intl/breakiterator/codepointiterator_internal.cpp b/ext/intl/breakiterator/codepointiterator_internal.cpp
index 723cfd5022..f6f75d2731 100644
--- a/ext/intl/breakiterator/codepointiterator_internal.cpp
+++ b/ext/intl/breakiterator/codepointiterator_internal.cpp
@@ -74,7 +74,11 @@ CodePointBreakIterator::~CodePointBreakIterator()
clearCurrentCharIter();
}
+#if U_ICU_VERSION_MAJOR_NUM >= 70
+bool CodePointBreakIterator::operator==(const BreakIterator& that) const