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
# Generated by Powerlevel10k configuration wizard on 2023-04-05 at 11:00 CEST. | |
# Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 53788. | |
# Wizard options: nerdfont-complete + powerline, small icons, unicode, lean, 1 line, | |
# compact, few icons, concise, instant_prompt=verbose. | |
# Type `p10k configure` to generate another config. | |
# | |
# Config for Powerlevel10k with lean prompt style. Type `p10k configure` to generate | |
# your own config based on it. | |
# | |
# Tip: Looking for a nice color? Here's a one-liner to print colormap. |
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
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. | |
# Initialization code that may require console input (password prompts, [y/n] | |
# confirmations, etc.) must go above this block; everything else may go below. | |
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then | |
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" | |
fi | |
zmodload zsh/zprof | |
export ZSH="/Users/pavelg/.oh-my-zsh" |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<toolchains> | |
<!-- JDK toolchains --> | |
<toolchain> | |
<type>jdk</type> | |
<provides> | |
<version>6</version> | |
<vendor>sun</vendor> | |
</provides> | |
<configuration> |
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
./gradlew wrapper --gradle-version 6.7 |
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
plugins { | |
id 'com.github.johnrengelman.shadow' version '6.0.0' | |
id 'java' | |
} | |
group 'dev.pgordon' | |
version '0.1.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
FROM openjdk:8-jre-alpine | |
ENV APPLICATION_USER ktor | |
RUN adduser -D -g '' $APPLICATION_USER | |
RUN ls -la | |
RUN mkdir /app | |
RUN chown -R $APPLICATION_USER /app | |
USER $APPLICATION_USER |
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 csv | |
from datetime import datetime | |
from instaloader import instaloader | |
def instaposts_streamer(query, date_from, date_to, filename): | |
cols = ['date', 'username', 'text', 'tags', 'permalink'] | |
with open(filename, 'w') as f: | |
csv.writer(f, delimiter='|').writerow(cols) |
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
I have a helper function to nuke everything so that our Continuous blah, cycle can be tested, erm... continuously. Basically it boils down to the following: | |
To clear containers: | |
docker rm -f $(docker ps -a -q) | |
To clear images: | |
docker rmi -f $(docker images -a -q) |
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
fun main() { | |
val s = "beans onion corn onion carrot potato avocado avocado carrot" | |
.split(" ") | |
.groupingBy { it } | |
.eachCount() | |
.toList() | |
.sortedWith(compareBy<Pair<String, Int>> { -it.second }.thenBy { it.first }) | |
// .sortedWith(compareBy({ -it.second }, { it.first })) // also possible | |
.forEach { (k, v) -> | |
println("$v x $k") |
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 io.ktor.* | |
fun main(args: Array<String>) { | |
val server = embeddedServer(Netty, port = 8080) { | |
routing { | |
get("/") { | |
call.respondText("Hello World!", ContentType.Text.Plain) | |
} | |
get("/demo") { | |
call.respondText("HELLO WORLD!") |
NewerOlder