This file contains 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
use std::mem; | |
/// Struct that can be used to store a vector of bytes and sent | |
/// to JS | |
#[repr(C)] | |
#[derive(Debug)] | |
pub struct JsBytes { | |
ptr: u32, | |
len: u32, | |
} |
This file contains 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
module Verify = { | |
type state = { | |
verifying: bool, | |
token: string | |
}; | |
type action = | |
| SendVerification string | |
| DidVerify; | |
let component = ReasonReact.reducerComponent "Verify"; | |
let make ::history ::email ::token _children => { |
This file contains 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
------------------------------ MODULE PingPong ------------------------------ | |
EXTENDS Integers | |
(***************************************************************************) | |
(* A simple ping pong game designed for learning *) | |
(***************************************************************************) | |
VARIABLES p1, \* Points of player 1 | |
p2, \* Points of player 2 | |
pc \* What the current state of the game is |
This file contains 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
extern crate libc; | |
use std::ffi::{CString, CStr}; | |
use std::mem; | |
trait Interop { | |
fn as_int(self, _: &mut Vec<CString>) -> libc::c_int; | |
} | |
impl Interop for i32 { |
This file contains 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
/Users/PenguinSoccer/.cargo/bin/cargo test --color=always --package cpro -- --nocapture | |
Compiling clippy_lints v0.0.151 | |
error[E0308]: mismatched types | |
--> /Users/PenguinSoccer/.cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.151/src/consts.rs:288:48 | |
| | |
288 | let def = self.tables.qpath_def(qpath, id); | |
| ^^ expected struct `rustc::hir::HirId`, found struct `syntax::ast::NodeId` | |
| | |
= note: expected type `rustc::hir::HirId` | |
found type `syntax::ast::NodeId` |
This file contains 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
<html> | |
<head> | |
<script> | |
var Module = { | |
wasmBinaryFile: "site.wasm", | |
onRuntimeInitialized: main, | |
}; | |
function run_with_ptr(vec_ptr, cb) { | |
const ptr = Module.HEAPU32[vec_ptr / 4]; |
This file contains 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
let pipe = (...funcs) => (...args) => funcs.reduce((vals, func) => ( | |
vals === args ? func(...vals) : func(vals) | |
), args) | |
let curry = (func) => function newCurry (...args) { | |
return args.length < func.length ? newCurry.bind(null, ...args) : func.bind(null, ...args)() | |
}() | |
let map = curry((func, arr) => { | |
let l = arr.length |
This file contains 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 React, { PropTypes, Component } from 'react'; | |
import { TransitionMotion, spring, presets } from 'react-motion'; | |
let paths = ['/scooby', '/dooby', '/doo'] | |
let lastPath | |
export default class RouteTransition extends Component { | |
static propTypes = { | |
pathname: PropTypes.string.isRequired |
NewerOlder