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 json | |
import urllib.request | |
import time | |
from datetime import datetime | |
MIN_TO_RUN = 1000 | |
BODY = '{"taxDivision":"PRT","postalCode":"90210","country":"US","state":"CA","city":"Beverly Hills","currency":"USD","items":[{"id":"ID_1","unitPrice":100.00,"quantity":1,"productClass":"Newspaper","extendedPrice":100.00}]}' |
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
ThreadFactory factory = com.google.appengine.api.ThreadManager.currentRequestThreadFactory(); | |
ExecutorService service = new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors(), 16, 60, TimeUnit.SECONDS, new SynchronousQueue<>(), factory); | |
List<Future<Void>> futures = new ArrayList<>(); | |
for (String tempStopAccountId : aristoDto.getTempStopHdAccountIds()) { | |
if (aristoDto.getProductFileDtoMap().get(tempStopAccountId) != null) { | |
aristoDto.getProductFileDtoMap().get(tempStopAccountId).setTempAccount(true); | |
} | |
Callable<Void> callable = () -> { | |
futures.add(processCancellation(tempStopAccountId)); |
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/bash | |
# script to be at the same level as input folder and output folder | |
INPUT_FOLDER='bittrex-bot/*' | |
OUTPUT_FOLDER='csv_output/' | |
OUTPUT_FILE_FORMAT=".csv" | |
for file in $INPUT_FOLDER | |
do | |
# file name | |
NAME=${file##*/} | |
number_of_lines=10 |
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/bash | |
# keep only latest 2 versions of a GAE service based on the latest version numbers | |
VERSIONS=$(gcloud app versions list --service $1 --sort-by '~version' --format 'value(version.id)') | |
COUNT=0 | |
echo "Keeping the $2 latest versions of the $1 service" | |
for VERSION in $VERSIONS | |
do | |
((COUNT++)) | |
if [ $COUNT -gt $2 ] | |
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
import React from 'react'; | |
import { connect } from 'react-redux'; | |
import { Link } from 'react-router'; | |
import { Field, Fields, reduxForm, getFormValues, initialize } from 'redux-form'; | |
import { PageHeader, PageBody, PageFooter } from '../../Layout'; | |
import FieldText, { FieldExpDate, | |
required, | |
validateName | |
} from '../../forms/FieldText'; | |
import FieldSelect from '../../forms/FieldSelect'; |
OlderNewer