This file contains 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
import org.apache.lucene.analysis.payloads.PayloadHelper; | |
import org.apache.lucene.search.similarities.DefaultSimilarity; | |
import org.apache.lucene.util.BytesRef; | |
public class CustomSolrSimilarity extends DefaultSimilarity { | |
@Override | |
public float scorePayload(int doc, int start, int end, BytesRef payload) { | |
if (payload != null) { | |
return PayloadHelper.decodeFloat(payload.bytes);; |
This file contains 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 | |
echo "\nLet me check if you can push this!" | |
echo "\nExecuting unit tests..." | |
testValidationResult=$(grunt test | grep "Done, without errors") | |
if [ "$testValidationResult" != "" ]; then | |
echo "\033[32mUnit tests execution passed. Wow, such tests, much green!\033[0m" | |
else |
This file contains 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
{#names}{@idx} | |
{@if cond="('{.}' == 0)"} | |
First is: {name} | |
{:else} | |
Other: {name} | |
{/if} | |
{/idx}{/names} |
This file contains 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 | |
echo "\nLet me check if you can commit!" | |
jsFiles=$(git diff --cached --name-only --diff-filter=ACM | grep ".js$") | |
lessFiles=$(git diff --cached --name-only --diff-filter=ACM | grep ".less$") | |
if [ "$jsFiles" = "" ]; then | |
echo "\033[32mNo JavaScript files were modified.\033[0m" | |
if [ "$lessFiles" = "" ]; then |
This file contains 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
// what we're working with | |
var characterList = 'acdegilmnoprstuw'; | |
// what we're going for | |
var theHashWeWereLookingFor = 956446786872726; | |
var theMagicString = ''; | |
//Now reverse engineer | |
while (theHashWeWereLookingFor > 7 ) { | |
var counter = 0; |
This file contains 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
var countryToLanguages = { AD: [ 'ca' ], | |
AE: [ 'ar', 'fa', 'en', 'hi', 'ur' ], | |
AF: [ 'fa', 'ps', 'uz', 'tk' ], | |
AG: [ 'en' ], | |
AI: [ 'en' ], | |
AL: [ 'sq', 'el' ], | |
AM: [ 'hy' ], | |
AO: [ 'pt' ], | |
AR: [ 'es', 'en', 'it', 'de', 'fr', 'gn' ], | |
AS: [ 'en', 'sm', 'to' ], |
NewerOlder