Skip to content

Instantly share code, notes, and snippets.

View loopDelicious's full-sized avatar
🌵

Joyce Lin loopDelicious

🌵
View GitHub Profile
<!doctype HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Getting Started with React and Webpack</title>
</head>
<body>
<div id="app"></div>
var React = require('react');
var ReactDOM = require('react-dom');
var Main = React.createClass({
render: function() {
return (
<div>
Hello World
</div>
)
module.exports = {
entry: "./app/components/Main.js",
output: {
filename: "public/bundle.js"
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
@loopDelicious
loopDelicious / Mapbox example
Created June 21, 2016 07:10
Mapbox API formatting
import os
accessToken = os.environ["MAPBOX_API_KEY"]
@app.route('/route_directions')
def get_directions_geojson():
"""Get directions via Mapbox Directions API with all the waypoints in the session."""
waypoints = session['waypoints']
route_list = []
@loopDelicious
loopDelicious / bcrypt.py
Created June 18, 2016 21:19
salt and hash passwords
import bcrypt
class User(db.Model):
"""User of website."""
__tablename__ = "users"
user_id = db.Column(db.Integer, autoincrement=True, primary_key=True)
email = db.Column(db.String(70), nullable=False)
password_hash = db.Column(db.String(60), nullable=False)