Skip to content

Instantly share code, notes, and snippets.

View hobroker's full-sized avatar
🐾

Igor Leahu hobroker

🐾
View GitHub Profile
@hobroker
hobroker / ofType.dart
Created August 23, 2020 18:52
ofType Stream extension
import 'dart:async';
import 'package:stream_transform/src/from_handlers.dart';
extension OfType<T> on Stream<T> {
Stream<T> ofType<ActionType>() {
return transform(fromHandlers(
handleData: (element, sink) {
if (element is ActionType) {
sink.add(element);
@hobroker
hobroker / debug.js
Last active December 5, 2020 22:11
logs stuff prefixed with the path from where the function was called
import debug from 'debug';
import {
bind,
filter,
identity,
join,
memoizeWith,
nthArg,
pipe,
slice,
@hobroker
hobroker / glc.py
Created December 3, 2019 01:13
Lazy commit in python
#!/usr/bin/env python3
from argparse import ArgumentParser
import os
from subprocess import check_output
import sys
import yaml
FZF_HEIGHT = 8
@hobroker
hobroker / glc.sh
Last active November 25, 2019 11:59
git lazy commit
#!/usr/bin/env bash
# Usage:
# $ glc refactor
set -e
# use any characters besides: [],;
_types="[🎨],[style],[improve structure / format of the code]
[⚡️],[perf],[improve performance]
SUCCESS 0 // Success
PENDING -1 // Pending
TIMEOUT -2 // Timeout
PARTIAL_RESULTS -3 // Partial results
ERROR -4 // Error
BADARG -5 // Bad Arguments
BADOPTION -6 // Mode not supported
UNSUPPORTED -7 // Unsupported function
OUT_OF_HEAP_SPACE -8 // Dynamic memory space exhausted
NOTUP -9 // Interface is not currently Up