Skip to content

Instantly share code, notes, and snippets.

@pawelprazak
pawelprazak / run.scala
Last active February 27, 2024 10:40
Excel Column to Integer
//> using scala 3.3.1
//> using options -deprecation -feature -Wunused:all -language:noAutoTupling -Wvalue-discard -Wnonunit-statement
//> using toolkit default
import scala.annotation.tailrec
@main def run(column: String): Unit =
println(Converter.convert(column.toUpperCase))
Pawes-MacBook-Pro:pulumi-594 pprazak$ export PULUMI_EXCESSIVE_DEBUG_OUTPUT=true;pulumi up -d
Enter your passphrase to unlock config/secrets
(set PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE to remember):
Previewing update (pulumi-594-private):
Type Name Plan Info
+ pulumi:pulumi:Stack pulumi-594-pulumi-594-private create 2 errors; 30 messages; 481 debugs
+ ├─ aws:iam:Role lambdaRole create
+ ├─ aws:iam:RolePolicyAttachment basicExecutionRole create
+ ├─ aws:lambda:Function helloWorldFunction create
+ └─ aws-apigateway:index:RestAPI helloWorldApi create
@pawelprazak
pawelprazak / Main.java
Last active November 4, 2021 14:05
Pulumi Java prototype API
package org.example;
import io.pulumi.Config;
import io.pulumi.Stack;
import io.pulumi.core.Output;
import io.pulumi.core.internal.annotations.OutputExport;
import io.pulumi.deployment.Deployment;
import org.example.k8s.core.v1.Namespace;
import org.example.k8s.core.v1.Secret;
import org.example.k8s.meta.v1.ObjectMeta;
@pawelprazak
pawelprazak / update.sh
Created September 26, 2017 09:38
Update all git repos in the directory
#!/usr/bin/env bash
dirs=(
$(find . -maxdepth 1 -mindepth 1 -type d -printf '%f\n')
)
for dir in ${dirs[@]}; do
echo "Updating '${dir}'"
(cd ${dir}; git fetch; git pull --rebase)
echo
@pawelprazak
pawelprazak / common.sh
Created April 29, 2016 13:58
Bash snipplets - common.sh
retry () {
echo -n " '$1' "
COMMAND=$1
NEXT_WAIT_TIME=1
MAX_WAIT_TIME=4
until ${COMMAND} || [ ${NEXT_WAIT_TIME} -eq ${MAX_WAIT_TIME} ]; do
echo " failure - wait for ${NEXT_WAIT_TIME} s"
sleep $(( NEXT_WAIT_TIME++ ))
done
@pawelprazak
pawelprazak / RestAssuredConfig
Created June 23, 2015 09:47
RestAssuredConfig for connection timeout
import com.jayway.restassured.RestAssured;
import com.jayway.restassured.config.RestAssuredConfig;
import org.apache.http.client.params.ClientPNames;
import org.apache.http.params.CoreConnectionPNames;
...
public static final RestAssuredConfig REST_ASSURED_SHORT_TIMEOUT_CONFIG = RestAssured.config()
.httpClient(httpClientConfig()
.setParam(ClientPNames.CONN_MANAGER_TIMEOUT, 1000L) // HttpConnectionManager connection return time
@pawelprazak
pawelprazak / ScalaSwingTableSelectionExample.scala
Created November 8, 2011 15:45
Example how to use Table in Scala Swing
import swing._
import swing.event.{TableRowsSelected, TableEvent, TableColumnsSelected, ButtonClicked}
case class TableColumnHeaderSelected(override val source:Table, column: Int) extends TableEvent(source)
object Example extends SimpleSwingApplication {
setSystemLookAndFeel()
def top = new MainFrame {
title = "Scala Swing Table Selection Example"