Skip to content

Instantly share code, notes, and snippets.

Oliver Mueller marcmo

View GitHub Profile
@marcmo
marcmo / ViewController.swift
Created Nov 12, 2018
example of RxAutomaton side effect handling
View ViewController.swift
//
// ViewController.swift
// RxAutomatonDemo
//
// Created by Yasuhiro Inami on 2016-08-15.
// Copyright © 2016 Yasuhiro Inami. All rights reserved.
//
import UIKit
import RxSwift
View bloc.dart
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 Jun 6, 2018
clean react native environment
View rakefile.rb
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 Jun 6, 2018
how to debug the message queue traffic in React Native
View bridgeSpy.js
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 Nov 21, 2017
update react native app with codepush
View codepush trace
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 Nov 21, 2017
update react native app with codepush
View codepush trace
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
View gist:a196b47faf82d2a370cc
# 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 ../../../..'
View gist:31b09a73e3f42227b391
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);
View default.nix
{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 Nov 21, 2013
working with IORef
View iorefs.hs
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
You can’t perform that action at this time.