Skip to content

Instantly share code, notes, and snippets.

View inputField.js
"use strict";
import React, { Component, PropTypes } from "react";
import { render } from "react-dom";
class Inputfield extends Component {
constructor(props) {
super(props);
this.state = { value: this.props.value };
this.handleChange = this.handleChange.bind(this);
}
View googleMaps.js
const googleMapsClient = require('@google/maps').createClient({
key: process.env.GOOGLE_SERVER_KEY,
});
module.exports.placesAutoComplete = (input, type) =>
new Promise((resolve, reject) =>
googleMapsClient.placesAutoComplete({
input,
type,
}, (error, res) => {
@badnorseman
badnorseman / app.js
Created Nov 19, 2016 — forked from datchley/app.js
"Getting Functional with Javascript" Blog post source files
View app.js
/**
* Primary application logic for our Functional Programming blog example
* See related blog series at: http://www.datchley.name/tag/functional-programming/
* Version: 2.0
*/
// A simple, resuable comparison for '>='
function greaterThanOrEqual(a, b) {
return a >= b
}
@badnorseman
badnorseman / webpack.config.js
Created Nov 7, 2016
Webpack for development
View webpack.config.js
var path = require("path");
var webpack = require("webpack");
module.exports = {
devtool: "eval-source-map",
entry: [
"webpack-hot-middleware/client",
"./src/scripts/App.js"
],
output: {
View gist:ef482cbeb329a2b6c4a3a92b9d9c5efd
Rails app
http://docs.railsbridge.org/job-board/job-board
PostgreSQL
https://www.digitalocean.com/community/tutorials/how-to-setup-ruby-on-rails-with-postgres
http://www.cyberciti.biz/faq/howto-add-postgresql-user-account/
https://kkob.us/2016/01/09/homebrew-and-postgresql-9-5/
Rails routing
http://guides.rubyonrails.org/routing.html
@badnorseman
badnorseman / Facebook.js
Last active Sep 12, 2020
Embed Facebook SDK into React app
View Facebook.js
"use strict";
import { connect } from "react-redux";
import { oauth } from "../../actions/auth_actions";
import "./facebook.css";
const Facebook = ({ dispatch }) => (
<button
className="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect facebook"
onClick={ev => {
ev.preventDefault();
View index.js
'use strict'
const express = require('express')
const bodyParser = require('body-parser')
const todos = require('./todos')
require('./env')
const app = express()
app.use(bodyParser.json())
app.use(express.static('public'))
@badnorseman
badnorseman / .babelrc
Last active Oct 31, 2016
webpack-react
View .babelrc
{
"presets": ["es2015", "react"]
}