Skip to content

Instantly share code, notes, and snippets.

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Requesting XML</title>
<script type="text/javascript" lang="javascript">
document.write(Date());
//Global XMLHTTP Request object
var XmlHttp;
//Creating and setting the instance of appropriate XMLHTTP Request object to a “XmlHttp” variable
function CreateXmlHttp() {
<?xml version="1.0" encoding="utf-8" ?>
<customerList xmlns="http://tempuri.org/CustomerListSchema.xsd">
<customer>
<CompanyName>Jack The Trader</CompanyName>
<ContactName>Jack</ContactName>
<Email>Jack@hotmail.com</Email>
<Phone>99988002</Phone>
<ShipToAddress>
<Name>Jack Receiver</Name>
<Street>Jurong</Street>
Ti.UI.backgroundColor = '#dddddd';
var url = "https://raw.github.com/appcelerator/Documentation-Examples/master/HTTPClient/data/json.txt";
var win = Ti.UI.createWindow();
var table = Ti.UI.createTableView();
var tableData = [];
var json, fighters, fighter, i, row, nameLabel, nickLabel;
var xhr = Ti.Network.createHTTPClient({
onload: function() {
<?xml version="1.0" encoding="utf-8" ?>
<bookstore>
<book category="COOKING">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var menuEntries = [ {name: "Run Query", functionName: "runQuery"} ];
ss.addMenu("HTTP Archive + BigQuery", menuEntries);
}
function runQuery() {
var projectNumber = 'httparchive';
var sheet = SpreadsheetApp.getActiveSheet();
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var menuEntries = [ {name: "Run Query", functionName: "runQuery"} ];
ss.addMenu("HTTP Archive + BigQuery", menuEntries);
}
function runQuery() {
var projectNumber = 'httparchive';
var sheet = SpreadsheetApp.getActiveSheet();
SELECT pages.pageid, url, cnt, libs, pages.rank rank FROM [httparchive:runs.2013_06_01_pages] as pages JOIN (
SELECT pageid, count(distinct(type)) cnt, GROUP_CONCAT(type) libs FROM (
SELECT REGEXP_EXTRACT(url, r'(dojo|angular|prototype|backbone|emberjs|sencha|scriptaculous).*\.js') type, pageid
FROM [httparchive:runs.2013_06_01_requests]
WHERE REGEXP_MATCH(url, r'dojo|angular|prototype|backbone|emberjs|sencha|scriptaculous.*\.js')
GROUP BY pageid, type
)
GROUP BY pageid
HAVING cnt >= 2
) as lib ON lib.pageid = pages.pageid
@jipengxiang
jipengxiang / 00-README.md
Created June 6, 2017 01:05 — forked from guumaster/00-README.md
How to upload a file with $.ajax to AWS S3 with a pre-signed url

Upload a file with $.ajax to AWS S3 with a pre-signed url

When you read about how to create and consume a pre-signed url on this guide, everything is really easy. You get your Postman and it works like a charm in the first run.

Then you open your browser, try your usual $.ajax() and send your PUT operation, and you hit the cold iced wall of AWS error message, a simple <Code>SignatureDoesNotMatch</Code> that will steal hours from your productivity.

So here I come to save you and give you a free working example of how to upload a file directly to AWS S3 from your browser. You are wellcome :).

@jipengxiang
jipengxiang / README.md
Created July 28, 2017 01:00 — forked from faermanj/README.md
API Authentication with Amazon Cognito

In the previous episodes we implemented the fundamental components of a tyical web application: "static" content and "dynamic" APIs. For each component, we´ve been using the most out of AWS services, such as S3, CloudFront, Lambda and API gateway. But so far we have only been working with public resources. Let us now learn more about user authentication and authorization in two very important services: AWS Identity and Access Management and Amazon Cognito. Even more importantly, let us integrate that within our React application ;)

  • Serverless Architecture Review
  • Introduction to Amazon Cognito
  • Cognito User Pools
  • Cognito Federated Identities
  • Cognito Identity SDK
  • AWS SDKs
  • Integrating with Javascript and React
  • Implementing Authentication Flows
@jipengxiang
jipengxiang / Web Server Tomcat
Last active June 27, 2018 03:32
Database mySQL
"WebServer": {
"Type": "AWS::EC2::Instance",
"Metadata" : {
"AWS::CloudFormation::Init" : {
"config" : {
"packages" : {
"yum" : {
"java-1.6.0-openjdk" : [],
"tomcat6" : [],
"httpd" : []