Skip to content

Instantly share code, notes, and snippets.

Thabo Fletcher thabofletcher

Block or report user

Report or block thabofletcher

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:b1cefe1529a019614721
List<IOException> deserializationErrors = new ArrayList<IOException>();
IntStream.range(0, items.length)
.parallel()
.forEach(i -> {
String messageBody = messages.get(i).getBody();
try {
items[i] = mapper.readValue(messageBody, type);
} catch (IOException e) {
deserializationErrors.add(e);
}
View gist:7f7d0909ac8a3e302826
IntStream.range(0, items.length)
.parallel()
.forEach(i -> {
String messageBody = messages.get(i).getBody();
try {
items[i] = mapper.readValue(messageBody, type);
} catch (IOException e) {
e.printStackTrace();
}
});
@thabofletcher
thabofletcher / index.php
Last active Mar 30, 2016
sanitize all dangerous superglobals
View index.php
foreach ($_GET as $key => $value) {
$_GET[$key] = filter_input(INPUT_GET, $key, FILTER_SANITIZE_STRING);
}
foreach ($_POST as $key => $value) {
$_POST[$key] = filter_input(INPUT_POST, $key, FILTER_SANITIZE_STRING);
}
foreach ($_COOKIE as $key => $value) {
$_COOKIE[$key] = filter_input(INPUT_COOKIE, $key, FILTER_SANITIZE_STRING);
View gist:2230d2e9766dd9f4a757
ngAnnotate: {
options: {
remove: true,
add: true,
singleQuotes: true
},
js: {
files: [
{
expand: true,
View gitsync.sh
#!/bin/sh
git stash
git pull
git push
git stash apply
You can’t perform that action at this time.