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
a.out: file format elf64-x86-64 | |
Contents of section .interp: | |
02a8 2f6c6962 36342f6c 642d6c69 6e75782d /lib64/ld-linux- | |
02b8 7838362d 36342e73 6f2e3200 x86-64.so.2. | |
Contents of section .note.ABI-tag: | |
02c4 04000000 10000000 01000000 474e5500 ............GNU. | |
02d4 00000000 03000000 02000000 00000000 ................ | |
Contents of section .note.gnu.build-id: | |
02e4 04000000 14000000 03000000 474e5500 ............GNU. |
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 Action = | |
| { type: 'ReturnsPromise' } | |
| { type: 'ReturnsUndefined' } | |
type R<A> = | |
| A extends { type: 'ReturnsPromise' } ? Promise<unknown> : never | |
| A extends { type: 'ReturnsUndefined' } ? undefined : never | |
| unknown | |
type Dispatch<A> = (action: A) => R<A> |
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
// Is there any way I can avoid allocating new memory here? `bindings` lives for the lifetime of the application, so it's not going out of scope. | |
void register_type(lua_State* L, const char* type_name, const binding bindings[], int num_bindings) { | |
for (int i = 0; i < num_bindings; i++) { | |
binding b = bindings[i]; | |
// This will go out of scope at the end of this function and is essentially akin to passing a null reference. It looks like this is because I am passing a reference to the local variable b rather than a reference to the array member bindings[i]. | |
lua_pushlightuserdata(L, &b); | |
// Now, if I malloc this binding (which is shit), this will work just fine, because the memory will be allocated on the heap and stay live until after this function exits. | |
binding* shit_binding = malloc(sizeof(binding)); |
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
// TODO: This does not work in mock mode. | |
import { HTTPAPI, NotFoundError } from "../api" | |
import React from "react" | |
type Maybe<T> = T | undefined | |
export interface Request<T> { | |
then<T2>(f: (data: Maybe<T>) => Maybe<T2>): Request<Maybe<T2>> | |
run(): Promise<Response<Maybe<T>>> | |
} |
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
class App extends Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
// We initialise this here since we need a sensible default | |
viewModel: new SchedulerData("2018-12-18", ViewTypes.Week) | |
// the resources key is removed because it is never accessed directly. | |
// test key is also removed because it's useless | |
} |
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
import * as React from "react" | |
interface ChildProps<T, E = any> { | |
data: T | undefined | |
error: E | undefined | |
isFetching: boolean | |
} | |
type State<T, E> = ChildProps<T, E> |
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
import { Switch, Route, withRouter } from "react-router" | |
import { BrowserRouter, Link } from "react-router-dom" | |
import invariant from "invariant" | |
import { Map } from "immutable" | |
const AsyncCapableRouteContext = React.createContext({ | |
registerRoute() {}, | |
unregisterRoute() {} | |
}) |
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
{- | |
Upserts into the given list, based on the given predicate. | |
If the given predicate matches any element in the list, then the first element | |
that matches that predicate in the list has the given function applied to it. A | |
new list is then returned with the new element present. | |
If the given predicate does not match any elements in the list, then the given | |
default element is inserted. |
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
placehodor |
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
struct size_t { | |
}; | |
int do_read_from_somewhere(size_t* output) { | |
size_t out; | |
*output = out; | |
return 0; | |
} |