Skip to content

Instantly share code, notes, and snippets.

Dan Jensen urbanvikingr

  • Copenhagen
Block or report user

Report or block urbanvikingr

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 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) => {
@urbanvikingr
urbanvikingr / 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
}
@urbanvikingr
urbanvikingr / 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
@urbanvikingr
urbanvikingr / Facebook.js
Last active Jul 27, 2019
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'))
@urbanvikingr
urbanvikingr / .babelrc
Last active Oct 31, 2016
webpack-react
View .babelrc
{
"presets": ["es2015", "react"]
}
You can’t perform that action at this time.