View networking.kt
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
object Networking { | |
private val appCache = Cache(File("cacheDir", "okhttpcache"), 10 * 1024 * 1024) | |
private val bootstrapClient = OkHttpClient.Builder().cache(appCache).build() | |
private val dns = DnsOverHttps.Builder().client(bootstrapClient) | |
.url("https://dns.google/dns-query".toHttpUrl()) | |
.bootstrapDnsHosts(InetAddress.getByName("8.8.4.4"), InetAddress.getByName("8.8.8.8")) | |
.build() | |
fun provideOkHttpClient(dataStorage: DataStorage): OkHttpClient { |
View Dockerfile
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
FROM ruby:2.7 | |
RUN mkdir -p /usr/src/app | |
COPY job.sh /usr/src/app | |
COPY collection /usr/src/app/collection | |
WORKDIR /usr/src/app | |
RUN gem install mosql | |
CMD ["bash", "mosql.sh"] |
View mosql.sh
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
#!/usr/bin/env bash | |
set -euo pipefail | |
MAP=('Collection1.yml' 'Collection2.yml' 'Collection3.yml') | |
for m in "${MAP[@]}" | |
do | |
mosql -c "./collection/${m}" --sql "${MOSQL_POSTGRESQL}" --mongo ${MOSQL_MONGODB} --only-db "${MOSQL_DB}" & | |
done |
View marathon-recovery.sh
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 | |
#read user inputs | |
echo Git Username: | |
read GITNAME | |
echo Git Password: | |
read GITPASS | |
echo DCOS URL: | |
read DCOSURL |
View gist:e73f5cb563a4e1d2184c
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
# build_args() { | |
# printf " --build-arg %s=%s" "$@" | |
# } | |
# sudo docker build $(build_args IMS_AD_PORT IMS_AD_PARSE_APP_ID IMS_AD_PARSE_JS_KEY IMS_AD_AWS_SQS_QUEUE) \ | |
# -t kamoljan/ad:1.0 api | |
View gist:6407d388e669a8127cb4
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
hfold install-awscli | |
if ! which aws >/dev/null; then | |
sudo apt-get -y install awscli | |
fi | |
hfold --end |
View gist:48a71140ac61ed5d98e9
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
package main | |
import ( | |
"image" | |
_ "image/jpeg" | |
_ "image/png" | |
"log" | |
"os" | |
"github.com/chai2010/webp" |
View gist:e4fc31c40661eb3bc3ea
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
def solution(A): | |
l = len(A) | |
if not (0 < l <= 100000): | |
return -1 | |
s_l = s_r = 0 | |
s = sum(A) | |
for i in range(l): |
View new_gist_file
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
package main | |
import ( | |
"fmt" | |
) | |
func print(i int) string { | |
if i%3 == 0 { | |
if i%5 == 0 { | |
return fmt.Sprintf("%d PipipiPopopo\n", i) |
View 0_reuse_code.js
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |