This is a curated list of iOS (Swift & ObjC) frameworks which are inspired by React and Elm.
- ReactSwift by @ColinEberhardt
- https://github.com/ColinEberhardt/ReactSwift
This is a curated list of iOS (Swift & ObjC) frameworks which are inspired by React and Elm.
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.
| import { h, Component } from 'preact'; | |
| /** Creates a new store, which is a tiny evented state container. | |
| * @example | |
| * let store = createStore(); | |
| * store.subscribe( state => console.log(state) ); | |
| * store.setState({ a: 'b' }); // logs { a: 'b' } | |
| * store.setState({ c: 'd' }); // logs { c: 'd' } | |
| */ |
| services: | |
| myservice: | |
| volumes: npm-cache:/root/.npm | |
| command: npm run install-start | |
| volumes: | |
| npm-cache: | |
| external: false |
| adb: implement "adb reverse <local> <remote>" | |
| This implements the logical opposite of 'adb forward', i.e. | |
| the ability to reverse network connections from the device | |
| to the host. | |
| This feature is very useful for testing various programs | |
| running on an Android device without root or poking at the | |
| host's routing table. | |
| Options and parameters are exactly the same as those for |
| "use strict" | |
| const fs = require("fs") | |
| const path = require("path") | |
| const transformer = require("react-native/packager/transformer") | |
| /* | |
| 1. put this file at your react native project workspace root, | |
| 2. then run command: | |
| `react-native start --transformer ./transformer.js` |
brew install ImageMagick
ffmpeg -ss 14:55 -i video.mkv -t 5 -s 480x270 -f image2 %04d.png
Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.
The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W).
If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).
If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so
| // connect() is a function that injects Redux-related props into your component. | |
| // You can inject data and callbacks that change that data by dispatching actions. | |
| function connect(mapStateToProps, mapDispatchToProps) { | |
| // It lets us inject component as the last step so people can use it as a decorator. | |
| // Generally you don't need to worry about it. | |
| return function (WrappedComponent) { | |
| // It returns a component | |
| return class extends React.Component { | |
| render() { | |
| return ( |