git clone https://github.com/grishka/libtgvoip.git
cd libtgvoip
# Build openssl-1.0.1 and opus-1.1 to prefix libraries/
# Save CMakeLists.txt here (in repo root)
mkdir build
cd build
# Save CallMakefile and main.cpp here
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "α": { "body": "α", "prefix": "\\alpha" }, | |
| "β": { "body": "β", "prefix": "\\beta" }, | |
| "γ": { "body": "γ", "prefix": "\\gamma" }, | |
| "δ": { "body": "δ", "prefix": "\\delta" }, | |
| "ζ": { "body": "ζ", "prefix": "\\zeta" }, | |
| "η": { "body": "η", "prefix": "\\eta" }, | |
| "θ": { "body": "θ", "prefix": "\\theta" }, | |
| "ι": { "body": "ι", "prefix": "\\iota" }, | |
| "κ": { "body": "κ", "prefix": "\\kappa" }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Immutable = require('immutable-ext') | |
| const {Just, Nothing} = require('data.maybe') | |
| const Task = require('data.task') | |
| // Setup | |
| const Reader = f => | |
| ({ | |
| run: f, | |
| map: g => Reader(x => g(f(x))), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # for json | |
| import json | |
| from collections import OrderedDict | |
| # for tl | |
| import re | |
| import struct | |
| import binascii | |
| __all__ = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function asyncToReact(fn) { | |
| class PromiseComponent extends React.Component { | |
| state = { waiting: true, result: null }; | |
| componentDidMount() { | |
| fn(...this.props.args).then(result => this.setState({ waiting: false, result })); | |
| } | |
| componentDidUpdate() { | |
| fn(...this.props.args).then(result => this.setState({ waiting: false, result })); | |
| } | |
| shouldComponentUpdate(newProps) { |
Proposal for a lightning talk at the Reactive 2016.
Keep calm and like/retweet it on Twitter and star this Gist to vote on this talk.
I work at Grammarly. We like React and happily use it in our applications. However, sometimes something goes wrong and bugs creep into the code. Here comes testing. It helps make us confident about the quality of our code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // The classic AJAX call - dispatch before the request, and after it comes back | |
| function myThunkActionCreator(someValue) { | |
| return (dispatch, getState) => { | |
| dispatch({type : "REQUEST_STARTED"}); | |
| myAjaxLib.post("/someEndpoint", {data : someValue}) | |
| .then( | |
| response => dispatch({type : "REQUEST_SUCCEEDED", payload : response}), | |
| error => dispatch({type : "REQUEST_FAILED", error : error}) | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function mapValues(obj, fn) { | |
| return Object.keys(obj).reduce((result, key) => { | |
| result[key] = fn(obj[key], key); | |
| return result; | |
| }, {}); | |
| } | |
| function pick(obj, fn) { | |
| return Object.keys(obj).reduce((result, key) => { | |
| if (fn(obj[key])) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type printable = Printable : 'a * ('a-> string) -> printable;; | |
| let myList = [Printable (2, string_of_int); Printable (true, string_of_bool)];; | |
| let printPrintable: printable -> string = fun p -> | |
| let Printable (data, printer) = p in | |
| printer data | |
| ;; | |
| let printables = [Printable (2, string_of_int); Printable (true, string_of_bool)];; | |
| let results = List.map printPrintable printables;; |
