Skip to content

Instantly share code, notes, and snippets.

View jasoet's full-sized avatar
🎯
Focusing

Deny Prasetyo jasoet

🎯
Focusing
View GitHub Profile
@jasoet
jasoet / gist:052bef9dabc1f37fc553d67d714f9906
Created November 3, 2016 07:44 — forked from mplatvoet/gist:bd029656bd17412f02cd
CompletableFuture with Kovenant Promises example
import nl.komponents.kovenant.*
import nl.komponents.kovenant.jvm.asDispatcher
import java.util.concurrent.CompletableFuture
import java.util.concurrent.ForkJoinPool
fun main(args: Array<String>) {
Kovenant.context {
// configure Kovenant with the same pool
// CompletableFutures use. By default it's
// the common pool.
@jasoet
jasoet / boostrap_xenial.sh
Last active October 18, 2016 20:57
Bootstrap Ubuntu Xenial
#!/bin/bash
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" >> /etc/apt/sources.list.d/docker.list
sudo apt-get update
sudo apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
sudo apt-get install -y docker-engine
sudo service docker start
curl -L https://github.com/docker/compose/releases/download/1.8.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Transactional
import org.jasoet.util.lang.orNotFound
import org.jasoet.db.entity.FinancialData
import org.jasoet.db.entity.Grant
import org.jasoet.db.repository.FinancialDataRepository
import org.jasoet.repository.GrantRepository
import org.jasoet.db.repository.master.InstitutionRepository
@jasoet
jasoet / InputStreamObservable.kt
Last active August 26, 2016 19:16
Extension Function for InputStream that convert it to Observable<String>
fun InputStream.toObservable(): Observable<String> {
class IOThread(private val inputStream: InputStream,
private val subscriber: Subscriber<in String>) : Thread() {
override fun run(): Unit {
Scanner(InputStreamReader(inputStream)).use {
while (it.hasNextLine()) {
subscriber.onNext(it.nextLine())
}
@jasoet
jasoet / locale.sh
Last active September 21, 2018 23:22
Set Locale on DigitalOcean Ubuntu (Remove Locale Error Message on console)
export LANGUAGE="en_US.UTF-8"
echo 'LANGUAGE="en_US.UTF-8"' >> /etc/default/locale
echo 'LC_ALL="en_US.UTF-8"' >> /etc/default/locale
@jasoet
jasoet / .eslintrc.js
Created May 11, 2016 01:03 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@jasoet
jasoet / .zshrc
Created April 24, 2016 11:49
ZSH Aliases
export PATH=/home/jasoet/.app/:/home/jasoet/.app/activator-dist-1.3.9/bin:$PATH
alias gw="./gradlew"
alias dc="docker-compose"
alias dcs="docker-compose stop"
alias dcr="docker-compose rm -f"
alias dcps="docker-compose ps"
alias dcl="docker-compose logs"
alias dcu="docker-compose up -d"
alias dcb="docker-compose build"
@jasoet
jasoet / .gitignore
Created September 20, 2015 08:57
.gitignore
build
deploy
.idea
.gradle
*.iml
logs
*.log
@jasoet
jasoet / zsh.md
Last active August 29, 2015 14:20 — forked from tsabat/zsh.md
@jasoet
jasoet / zsh.md
Last active August 29, 2015 14:20 — forked from tsabat/zsh.md