Skip to content

Instantly share code, notes, and snippets.

@thomas-jeepe
thomas-jeepe / FormGenerator.js
Last active October 12, 2015 18:46
FormGenerator, not for use so copy off of it
import React from 'react'
import { TextField, RaisedButton, FlatButton, Paper, Toggle, RadioButton, RadioButtonGroup, DropDownMenu } from 'material-ui'
//This is a HOC which adds required material-ui themes to the component
//You should be able to not use material-ui at all or add childContextTypes with the theme
import MuiComponent from '../containers/MuiComponent'
/*
You dont have to use these components so I recommened you change styles to you liking.
*/
let FormValues;
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}) {
@thomas-jeepe
thomas-jeepe / RaisedButton.js
Created November 4, 2015 02:58
Material design button with react-motion
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}
}
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 / RandomFuncs.js
Last active December 12, 2015 18:08
some useful funcs
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
<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 / Console
Created August 20, 2017 02:58
The console output
/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`
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 {
------------------------------ 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
module Verify = {
type state = {
verifying: bool,
token: string
};
type action =
| SendVerification string
| DidVerify;
let component = ReasonReact.reducerComponent "Verify";
let make ::history ::email ::token _children => {