Skip to content

Instantly share code, notes, and snippets.

thomas-jeepe

Block or report user

Report or block thomas-jeepe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ffi.rs
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,
}
View launchpad.re
module Verify = {
type state = {
verifying: bool,
token: string
};
type action =
| SendVerification string
| DidVerify;
let component = ReasonReact.reducerComponent "Verify";
let make ::history ::email ::token _children => {
View PingPong.tla
------------------------------ 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
View worker.rs
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 {
@thomas-jeepe
thomas-jeepe / Console
Created Aug 20, 2017
The console output
View Console
/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`
View index.html
<html>
<head>
<script>
var Module = {
wasmBinaryFile: "site.wasm",
onRuntimeInitialized: main,
};
function run_with_ptr(vec_ptr, cb) {
const ptr = Module.HEAPU32[vec_ptr / 4];
@thomas-jeepe
thomas-jeepe / RandomFuncs.js
Last active Dec 12, 2015
some useful funcs
View RandomFuncs.js
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
View PageTransition.js
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
@thomas-jeepe
thomas-jeepe / RaisedButton.js
Created Nov 4, 2015
Material design button with react-motion
View RaisedButton.js
import React, { Component } from 'react';
import ReactDom from 'react-dom'
import { TransitionMotion, spring, Motion } from 'react-motion';
class RaisedButton extends Component {
constructor() {
super()
this.state = {mouse: [], now: 't' + 0, height: 0, width: 0}
}
View TouchRippleButton.js
import React, { Component } from 'react';
import {TransitionMotion, spring, utils} from 'react-motion';
export default class Demo extends Component {
constructor() {
super()
this.state = {mouse: [], now: 't' + 0}
}
handleMouseMove({pageX, pageY}) {
You can’t perform that action at this time.