This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Pick the cheapest plan | |
final AdjustmentPlan plan = plans.stream() | |
.min(Comparator.comparing(AdjustmentPlan::getMultiplier)) | |
.orElse(null); | |
final Double multiplier = plan != null ? plan.getMultiplier() : 1.0; | |
List<String> exceptions = new ArrayList<>(); | |
if (plan != null && PlanType.EXCEPTION.equals(plan.getPlanType())) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// play.golang.org/p/-fTKnXVctQ0 | |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
) | |
type Employee struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// play.golang.org/p/IAGoPiUdUMc | |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
) | |
type Employee struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package util | |
import ( | |
"encoding/json" | |
) | |
func Unmarshall(jsonPayload string, v interface{}) error { | |
return json.Unmarshal([]byte(jsonPayload), v) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for zip in *.zip | |
do | |
dirname=`echo $zip | sed 's/\.zip$//'` | |
if mkdir "$dirname" | |
then | |
if cd "$dirname" | |
then | |
unzip ../"$zip" | |
cd .. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for zip in *.zip | |
do | |
dirname=`echo $zip | sed 's/\.zip$//'` | |
7z x $zip -o./$dirname | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//For Mocha | |
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "Mocha Tests", | |
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", | |
"args": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
S3Bucket: | |
Type: "AWS::S3::Bucket" | |
Properties: | |
BucketName: | |
Fn::Sub: "${TagProduct}-${TagEnvironment}-${TagEnvironmentNumber}-audit-${AWS::AccountId}-${AWS::Region}" | |
NotificationConfiguration: | |
QueueConfigurations: | |
- Event: "s3:ObjectCreated:*" | |
Queue: | |
Fn::GetAtt: [ "ObjectCreatedQueueAudit", "Arn" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling/hosts | |
https://block.energized.pro/unified/formats/hosts | |
https://block.energized.pro/extensions/regional/formats/hosts | |
https://raw.githubusercontent.com/jerryn70/GoodbyeAds/master/Extension/GoodbyeAds-Xiaomi-Extension.txt | |
# white list | |
https://github.com/anudeepND/whitelist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static boolean isStringInputInTheList(String input, List<String> list) { | |
return Optional.ofNullable(list) | |
.map(Collection::parallelStream) | |
.orElseGet(Stream::empty) | |
.anyMatch(x -> StringUtils.isNotBlank(input) && x.equals(input)); | |
} | |
// where: | |
// StringUtils is the org.apache.commons.lang3.StringUtils |