Skip to content

Instantly share code, notes, and snippets.

@DomiR
DomiR / observable-queue.ts
Created March 11, 2018 18:54 — forked from evxn/observable-queue.ts
Add Observable-like entities to a queue (Promises, Observables, Subjects, Arrays, generators, Iterables). After each stream is completed (i.e. Promise resolved) it's elements are emitted to the result stream in the order of addition (first in first out). Each subscriber receives result only for items added to queue after the subscription.
import {Subject} from 'rxjs/Subject';
import {BehaviorSubject} from 'rxjs/BehaviorSubject';
import {Observable, ObservableInput} from 'rxjs/Observable';
import {concatMap, switchMap} from 'rxjs/operators';
enum QueueActions {
RESET = 'RESET',
ADD = 'ADD',
}
@DomiR
DomiR / react-native-module-extension.md
Last active March 26, 2022 09:27
Extend objective c react-native module

facebook/react-native#1908 (comment) @alinz, @brentvatne & @jaygarcia

So lets say you want to add eval method to WebView component. What you have to do is: use category feature in objective-c.

// RCTWebView+WebViewExBridge.h

#import "RCTWebView.h"

@interface RCTWebView (WebViewExBridge)
@DomiR
DomiR / Iphone.md
Last active October 22, 2021 00:05
Iphone passwordless ssh

Passwordless SSH

If you have no own key in ~/.ssh/ calld id_rsa.pub then create one:

ssh-keygen -t rsa

Copy the public file to the iphone

@DomiR
DomiR / docker.md
Created September 5, 2017 16:37
Install docker on mac

Prerequisites

Make sure you have installed Homebrew and (Homebrew-Cask)[http://caskroom.io/].

# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Install Homebrew-cask
brew install caskroom/cask/brew-cask
@DomiR
DomiR / GitHelpers.md
Last active June 27, 2017 11:50
Git helpers

Git: how to merge my local, working changes into another branch

Since your files are not yet committed in branch1:

git stash
git checkout branch2
git stash pop

or

@DomiR
DomiR / saveCanvas.java
Created May 11, 2017 22:48
Save android canvas
public Bitmap saveSignature(){
Bitmap bitmap = Bitmap.createBitmap(this.getWidth(), this.getHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
this.draw(canvas);
File file = new File(Environment.getExternalStorageDirectory() + "/sign.png");
try {
bitmap.compress(Bitmap.CompressFormat.PNG, 100, new FileOutputStream(file));
aria2c -c -x10 -s10 -U 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:33.0) Gecko/20100101 Firefox/33.0' --load-cookies=cookies.txt https://developer.apple.com/services-account/download\?path\=/iOS/iOS_9_beta_5/iOS_9_beta_5__iPhone_5s_Model_A1457_A1518_A1528_A1530__13A4325c.zip
@DomiR
DomiR / xcode-plugins.sh
Created February 4, 2016 17:29
Make Alcatraz working again
# Xcode
find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3 | xargs -I{} defaults write {} DVTPlugInCompatibilityUUIDs -array-add $(defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID)
# Xcode beta
find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3 | xargs -I{} defaults write {} DVTPlugInCompatibilityUUIDs -array-add $(defaults read /Applications/Xcode-beta.app/Contents/Info DVTPlugInCompatibilityUUID)
@DomiR
DomiR / manual
Created January 8, 2014 09:30
Uni Stuttgart VPN
1. Install openconnect via
sudo brew install openconnect
2. Install tuntap
sudo brew install tuntap
-> add to startup
3. Install some kind of script executor on wlan change
run vpn-script with credentials
@DomiR
DomiR / install.opencv.readme.md
Last active January 1, 2016 00:49
How to install opencv on Mavericks