Skip to content

Instantly share code, notes, and snippets.

View ohze's full-sized avatar
🎉
Be happy

ohze.net ohze

🎉
Be happy
View GitHub Profile
@japgolly
japgolly / upgrade.md
Last active April 26, 2022 02:55
Scala 2.13 migration notes

scalafix

addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.13")
import scalafix.sbt.ScalafixPlugin.autoImport.{scalafixDependencies, scalafixSemanticdb}

scalafixDependencies in ThisBuild += "org.scala-lang.modules" %% "scala-collection-migrations" % "2.1.4",
@ohze
ohze / flutter-sources.jar.sc
Last active March 15, 2019 09:15
fetch and archive flutter-sources.jar for using in Android Studio / IntelliJ
// This script will fetch java source files for <flutter.sdk>/bin/cache/artifacts/engine/android-arm/flutter.jar
// and pack into ~/flutter-sources.jar
// Run this script by [amm](http://ammonite.io/#ScalaScripts):
// + install amm:
// sudo sh -c '(echo "#!/usr/bin/env sh" && curl -L https://github.com/lihaoyi/Ammonite/releases/download/1.6.4/2.12-1.6.4) > /usr/local/bin/amm && chmod +x /usr/local/bin/amm'
// + run:
// amm flutter-sources.jar.sc
// Then you can Choose Sources for the flutter classes in IntelliJ/ Android Studio
@ohze
ohze / git.sh
Created July 24, 2017 06:51
specify ssh-key with git command
#!/bin/sh
# The MIT License (MIT)
# Copyright (c) 2013 Alvin Abad
if [ $# -eq 0 ]; then
echo "Git wrapper script that can specify an ssh-key file
Usage:
git.sh -i ssh-key-file git-command
"
@Robyer
Robyer / maven-publish-helper-usage.gradle
Last active May 14, 2024 05:41
Gradle script for publishing Android library with sources and javadoc to Maven repository using maven-publish plugin.
// You can use maven-publish-helper.gradle script without changes and even share it between multiple
// modules. Just place the maven-publish-helper.gradle file in the root directory of your project,
// then apply it at the bottom of your module's build.gradle file like this:
// ...content of module's build.gradle file...
apply from: '../maven-publish-helper.gradle'
publishing {
publications {
@petitviolet
petitviolet / AkkaStreamPracWithActor.scala
Last active April 11, 2021 21:07
Akka-Stream with Actor using ActorPublisher and ActorSubscriber
package net.petitviolet.ex.persistence.task
import akka.NotUsed
import akka.actor._
import akka.pattern.ask
import akka.stream.actor.ActorSubscriberMessage.{ OnComplete, OnNext }
import akka.stream.actor.{ ActorPublisher, ActorSubscriber, OneByOneRequestStrategy, RequestStrategy }
import akka.stream.{ ActorMaterializer, ClosedShape }
import akka.util.Timeout
import org.reactivestreams.Publisher
@e7d
e7d / sample.sh
Last active May 11, 2024 13:46
Bash "try catch"
#!/bin/bash
export AnException=100
export AnotherException=101
# start with a try
try
( # open a subshell !!!
echo "do something"
[ someErrorCondition ] && throw $AnException
@Plumillon
Plumillon / PFRecyclerViewAdapter.java
Last active April 1, 2022 07:29
Simpler generic RecyclerView.Adapter and RecyclerView.ViewHolder with click listener
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@lmakarov
lmakarov / install-docker-compose.sh
Created June 30, 2015 16:47
Install docker-compose in boot2docker 1.7.0+
#!/bin.sh
DOCKER_COMPOSE_VERSION=1.3.0
# Download docker-compose to the permanent storage
echo 'Downloading docker-compose to the permanent VM storage...'
sudo mkdir -p /var/lib/boot2docker/bin
sudo curl -sL https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o /var/lib/boot2docker/bin/docker-compose
sudo chmod +x /var/lib/boot2docker/bin/docker-compose
sudo ln -sf /var/lib/boot2docker/bin/docker-compose /usr/local/bin/docker-compose
@kevinswiber
kevinswiber / rpc_vs_rest.md
Last active April 11, 2021 16:50
A brief moment of RPC vs. REST.
@plentz
plentz / nginx.conf
Last active May 17, 2024 09:08
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048