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
| my $filename = 'speclist.txt'; | |
| my $write_file = "parsed_taxonomy_id.txt"; | |
| open(IN, '<', $filename) | |
| or die "Could not open file '$filename' $!"; | |
| open(my $out, ">", $write_file) | |
| or die "Could not open file $write_file"; | |
| while(<IN>){ | |
| if ($_ =~ /(\d+)\:\sN=(.*)/){ | |
| print $out "$1|$2\n"; |
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
| my ($type, $search_term) = @ARGV; | |
| $file = 'parsed_tax_name.txt'; | |
| sub get_tax_id_or_name{ | |
| open(FILE, "<$file") or | |
| die("Could not open log file. $!\n"); | |
| while(<FILE>) { | |
| if ($type eq "-t" and $_ =~ /$search_term\|(.*)/){ | |
| return $1; |
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
| import org.scalatest.matchers.{MatchResult, Matcher} | |
| import play.api.mvc.Result | |
| trait CustomMatcher { | |
| def beStatus(status: Int) = Matcher { obj: Result => | |
| MatchResult( | |
| obj.header.status == status, | |
| s"${obj.header.status} was not equal $status", | |
| s"${obj.header.status} was equal $status", | |
| ) |
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/bash | |
| # Set variables | |
| USERNAME=$MONGODB_USERNAME | |
| PASSWORD=$MONGODB_PASSWORD | |
| DB_NAME=$MONGODB_DBNAME | |
| # Create User | |
| mongo $DB_NAME --eval "db.createUser({user: '$USERNAME',pwd: '$PASSWORD',roles: [{role: 'readWrite',db: '$DB_NAME'}]});" |
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
| // In build.sbt file | |
| lazy val hub = (project in file(".")) | |
| .enablePlugins(GatlingPlugin) | |
| .settings(inConfig(Gatling)(Defaults.testSettings): _*) | |
| // for simulations | |
| scalaSource in Gatling := baseDirectory.value / "test/gatling/" | |
| // for data | |
| resourceDirectory in Gatling := baseDirectory.value / "test/gatling/resources/data/" |
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
| function debounce(event, func) { | |
| const target = event.target; | |
| clearTimeout(target.setTimeoutId); | |
| target.setTimeoutId = setTimeout(() => func(target.value), 500); | |
| } | |
| document.getElementById("name") | |
| .addEventListener("keyup", (event) => { | |
| debounce(event, (value) => { |
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
| const memo = () => { | |
| const cache = {}; | |
| return function() { | |
| const key = Object.values(arguments).join('_'); | |
| if (key in cache) { | |
| return cache[key]; | |
| }; | |
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
| var TrendyolPaymentCalculator = (() => { | |
| const $this = {}; | |
| const months = ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'] | |
| $this.calculate = async () => { | |
| const calculatableResult = checkForCalculatable(); | |
| if (!calculatableResult.isValid) { | |
| console.error(calculatableResult.message); |
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
| Function.prototype.toString = function() { | |
| return this(); | |
| } | |
| const multiplier = (...args) => { | |
| if (args.length === 0) { | |
| return multiplier; | |
| } | |
| const rest = args.splice(1); | |
| if (rest.length === 0 && Array.isArray(args[0])) { |
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
| const scorePrinter = function() { | |
| const SCORES = [ | |
| {score: 90, text: 'AA ile dersi gectiniz'}, | |
| {score: 85, text: 'BA ile dersi gectiniz'}, | |
| {score: 80, text: 'BB ile dersi gectiniz'}, | |
| {score: 75, text: 'CB ile dersi gectiniz'}, | |
| {score: 50, text: 'Kosullu gectiniz.'}, | |
| ]; | |
| const print = (score) => { |
OlderNewer