Skip to content

Instantly share code, notes, and snippets.

View mbalex99's full-sized avatar

Maximilian Alexander mbalex99

View GitHub Profile
@puffybsd
puffybsd / launch.json
Last active July 7, 2022 11:56
VSCode launcher for rust using lldb
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug-LLDB",
"type": "lldb",
"request": "launch",
@zxbodya
zxbodya / render-react-with-rxjs.md
Last active November 1, 2021 08:49
React with RxJS, reactive way :)

Observable React elements with RxJS

Note: if you want to skip history behind this, and just looking for final result see: rx-react-container

When I just started using RxJS with React, I was subscribing to observables in componentDidMount and disposing subscriptions at componentWillUnmount.

But, soon I realised that it is not fun to do all that subscriptions(that are just updating property in component state) manually, and written mixin for this...

Later I have rewritten it as "high order component" and added possibility to pass also obsarvers that will receive events from component.

@mbalex99
mbalex99 / AFNetworking Parsing
Created September 18, 2013 06:32
JSON AFNetworking
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"link"]];
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request
success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
NSDictionary *jsonDict = (NSDictionary *) JSON;
NSArray *products = [jsonDict objectForKey:@"products"];
[products enumerateObjectsUsingBlock:^(id obj,NSUInteger idx, BOOL *stop){
NSString *productIconUrl = [obj objectForKey:@"icon_url"];
}];
} failure:^(NSURLRequest *request, NSHTTPURLResponse *response,