Skip to content

Instantly share code, notes, and snippets.

View marcmo's full-sized avatar

Oliver Mueller marcmo

View GitHub Profile
@marcmo
marcmo / ViewController.swift
Created November 12, 2018 11:37
example of RxAutomaton side effect handling
//
// ViewController.swift
// RxAutomatonDemo
//
// Created by Yasuhiro Inami on 2016-08-15.
// Copyright © 2016 Yasuhiro Inami. All rights reserved.
//
import UIKit
import RxSwift
class A {
Subject<int> _stateSubject;
Stream<int> _state;
Stream<int> get state {
return _state;
}
final Stream<DocumentSnapshot> _visitorCount =
Firestore.instance.document('ServerData/serverStatus').snapshots();
A() {
@marcmo
marcmo / rakefile.rb
Created June 6, 2018 10:54
clean react native environment
require 'rake'
NODE_PATH="./node_modules"
task :cleanReactCache do
sh "rm -rf $TMPDIR/react-*"
end
task :cleanWatchman do
sh "watchman watch-del-all"
end
@marcmo
marcmo / bridgeSpy.js
Created June 6, 2018 07:30
how to debug the message queue traffic in React Native
import MessageQueue, { TO_JS } from 'react-native/Libraries/BatchedBridge/MessageQueue.js';
const handleCallsToJS = (info) => {
// ...
};
const handleCallsToNative = (info) => {
// ...
};
const spyFunction = (info) => {
@marcmo
marcmo / codepush trace
Created November 21, 2017 11:11
update react native app with codepush
Detecting android app version:
Using the target binary version value "1.3.10" ...
Running "react-native bundle" command:
node node_modules/react-native/local-cli/cli.js bundle --assets-dest /var/folders/rq/_gpzs05x4pzg4d_ckvhr1mpr0000gn/T/CodePush --bundle-output /var/folders/rq/_gpzs05x4pzg4d_ckvhr1mpr0000gn/T/CodePush/index.android.bundle --dev false --entry-file index.android.js --platform android
bundle: start
bundle: finish
bundle: Writing bundle output to: /var/folders/rq/_gpzs05x4pzg4d_ckvhr1mpr0000gn/T/CodePush/index.android.bundle
@marcmo
marcmo / codepush trace
Created November 21, 2017 11:11
update react native app with codepush
Detecting android app version:
Using the target binary version value "1.3.10" ...
Running "react-native bundle" command:
node node_modules/react-native/local-cli/cli.js bundle --assets-dest /var/folders/rq/_gpzs05x4pzg4d_ckvhr1mpr0000gn/T/CodePush --bundle-output /var/folders/rq/_gpzs05x4pzg4d_ckvhr1mpr0000gn/T/CodePush/index.android.bundle --dev false --entry-file index.android.js --platform android
bundle: start
bundle: finish
bundle: Writing bundle output to: /var/folders/rq/_gpzs05x4pzg4d_ckvhr1mpr0000gn/T/CodePush/index.android.bundle
# enable color support of ls and also add handy aliases
alias pyweb='python -m SimpleHTTPServer'
## a quick way to get out of current directory ##
alias cd..='cd ..'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
extern crate hyper;
use hyper::Client;
use hyper::header::HeaderFormat;
fn main() {
let mut client = Client::new();
let mut res = client.head("http://example.org/")
.send().unwrap();
println!("StatusCode: {}", res.status);
{stdenv, fetchgit}:
stdenv.mkDerivation {
name = "dlt-viewer-2.12.0";
builder = ./builder.sh;
src = fetchgit {
url = "http://git.projects.genivi.org/dlt-viewer.git";
rev = "v2.12.0";
sha256 = "1hh8v0kcnipwrfz4d45d6pm5bzbm9wgbrdgg0ir2l7wyshbkff6i";
};
@marcmo
marcmo / iorefs.hs
Created November 21, 2013 13:50
working with IORef
import Data.IORef
import Data.Maybe (fromJust,isJust)
import Control.Monad
type Env = IORef [(String, IORef String)]
nullEnv :: IO Env
nullEnv = newIORef []
sessionEnv :: IO Env