Skip to content

Instantly share code, notes, and snippets.

@Morgantheplant
Morgantheplant / Palindrome finder
Last active August 29, 2015 13:56
Prompts user for a price and then returns the next highest palindrome.
var ask = prompt("Enter a price to find the next palindromic number!");
var removeDec = function (j) {
return parseInt(j * 100);
}
var c = removeDec(ask);
var reverseIt = function (x) {
var a = ""
x = x.toString();
@Morgantheplant
Morgantheplant / index.js
Last active August 29, 2015 14:24
Events test
'use strict';
var DOMElement = require('famous/dom-renderables/DOMElement');
var FamousEngine = require('famous/core/FamousEngine');
var GestureHandler = require('famous/components/GestureHandler')
FamousEngine.init();
// UI events are sent up to parent nodes.
// Parent nodes emit events down
<input type="text" id="myinput" />
<input type="date" id="date"/>
<input type="text" id="time" />
<div id="countdown"></div>
#grey{
background-image: url('https://upload.wikimedia.org/wikipedia/commons/1/1d/Marcus_Thames_Tigers_2007.jpg');
background-size: cover;
height: 252px;
width: 480px;
}
#flag {
position: absolute;
z-index:3;
import React, { Component, PropTypes } from "react";
import { connect } from 'react-redux';
import { nextPage, previousPage, setPage } from '../actions/pager_actions';
import Pager from '../components/Pager';
class PagerContainer extends Component {
render() {
return (
<Pager
currentPage={+(this.props.currentPage)}
@Morgantheplant
Morgantheplant / PortalPopUp.jsx
Last active February 22, 2019 19:51
abstracted popup logic
import PropTypes from 'prop-types';
import React, {Component} from 'react';
// wrapper component that will call dismiss if a click is detected outside of itself or its children
class DismissableClick extends Component {
constructor(props) {
super(props);
this.handleMouseDown = this.handleMouseDown.bind(this);
this.removeListener = this.removeListener.bind(this);
}