View Google App Engine Java.java
import static com.google.appengine.api.urlfetch.FetchOptions.Builder.withDefaults; | |
import java.io.IOException; | |
import java.net.URL; | |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import com.google.appengine.api.urlfetch.HTTPMethod; |
View Google App Engine Java.java
import static com.google.appengine.api.urlfetch.FetchOptions.Builder.withDefaults; | |
import java.io.IOException; | |
import java.net.HttpURLConnection; | |
import java.net.URL; | |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; |
View Google App Engine Java.java
package com.floreysoft.sandbox; | |
import static com.google.appengine.api.urlfetch.FetchOptions.Builder.withDefaults; | |
import java.io.IOException; | |
import java.net.HttpURLConnection; | |
import java.net.URL; | |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; |
View Plain Java.java
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.net.URL; | |
public class DownloadGET { | |
public static void main(String[] args) throws Exception { |
View Google Apps Script.js
function postComplex() { | |
// to show that stringifying real dates does work as well | |
var date = new Date(); | |
var events = { | |
name: "Olli", | |
events: [ | |
{ | |
title: "Strategy Meeting", | |
startTime: "Fri Feb 01 10:00:00 CET 2013", | |
endTime: "Fri Feb 01 11:30:00 CET 2013", |
View server-side-react-redux-router.js
export default function renderRoute(request, reply) { | |
const store = configureStore(); | |
store.dispatch(match(request.path, (error, redirectLocation, routerState) => { | |
if (redirectLocation) { | |
reply.redirect(redirectLocation.pathname + redirectLocation.search); | |
} else if (error) { | |
reply(error.message).code(500); | |
} else if (!routerState) { | |
reply('Not found').code(404); | |
} else { |