Skip to content

Instantly share code, notes, and snippets.

@jivimberg
jivimberg / CoroutinesUtils.kt
Last active October 11, 2023 00:16
SQS Consumer using Kotlin coroutines and pool of workers.
package com.jivimberg.sqs.published
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.isActive
import kotlinx.coroutines.yield
import java.lang.Thread.currentThread
suspend fun CoroutineScope.repeatUntilCancelled(block: suspend () -> Unit) {
while (isActive) {
@takahirom
takahirom / EventBus.kt
Last active June 9, 2022 10:21
EventBus by Kotlin coroutine
import kotlinx.coroutines.experimental.channels.BroadcastChannel
import kotlinx.coroutines.experimental.channels.ConflatedBroadcastChannel
import kotlinx.coroutines.experimental.channels.ReceiveChannel
import kotlinx.coroutines.experimental.channels.filter
import kotlinx.coroutines.experimental.channels.map
import kotlinx.coroutines.experimental.launch
import javax.inject.Inject
import javax.inject.Singleton
anonymous
anonymous / costa_rica.csv
Created March 4, 2018 18:38
artisan csv files
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Date:03.02.2017 Unit:F CHARGE:00:59 TP:01:45 DRYe:06:13 FCs:09:28 FCe: SCs: SCe: DROP:11:58 COOL: Time:18:12
Time1 Time2 BT ET Event Gas*30 Extra 2 "Gas*10""WC" Extra 2
00:04 416.75 412.95 162.64 2.63 26.32 1.0
00:07 417.7 412.85 162.86 2.64 26.43 1.0
00:09 418.1 412.9 162.46 2.62 26.23 1.0
00:12 417.8 413.2 162.12 2.61 26.06 1.0
00:16 417.5 413.55 162.48 2.62 26.24 1.0
00:19 416.8 413.025 153.8 2.19 21.9 1.0
00:22 416.25 412.5 153.52 2.18 21.76 1.0
00:25 415.8 410.85 153.72 2.19 21.86 1.0
@sarupbanskota
sarupbanskota / node_8_v8_options
Last active April 18, 2024 12:31
node 8 v8 options
$ node --v8-options > node_8_v8_options
SSE3=1 SSSE3=1 SSE4_1=1 SAHF=1 AVX=1 FMA3=1 BMI1=1 BMI2=1 LZCNT=1 POPCNT=1 ATOM=0
Usage:
shell [options] -e string
execute string in V8
shell [options] file1 file2 ... filek
run JavaScript scripts in file1, file2, ..., filek
shell [options]
shell [options] --shell [file1 file2 ... filek]
@nkbt
nkbt / .eslintrc.js
Last active May 11, 2024 13:03
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 23, 2024 23:26
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k