This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form onsubmit="return false;" class="pure-form" style="border-top: 1px solid #eee;border-bottom:1px solid #eee;background:#fafafa;margin:30px 0;padding:20px 10px;text-align:center"> | |
<input id="user-input" autofocus type="text" placeholder="Type a word ..." style="width:100%;max-width:600px;outline:0" /> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request').defaults({ | |
headers: { | |
'X-header1': myvar, | |
'Content-Type': 'application/json' | |
} | |
}); | |
// Now request will automatically send the headers specified above on every request. | |
request.get('http://www.example.com', function(err, resp, body){ | |
//... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<results> | |
<result> | |
<title>Bob</title> | |
<description>A story about Bob</description> | |
</result> | |
<result> | |
<title>Alice</title> | |
<description>A story about Alice</description> | |
</result> | |
</results> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<results> | |
<result policy="bobPolicy"> | |
<title>Bob</title> | |
<description>A story about Bob</description> | |
</result> | |
<result policy="alicePolicy"> | |
<title>Alice</title> | |
<description>A story about Alice</description> | |
</result> | |
</results> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ results : [ | |
{ title : 'Bob', description : 'A story about bob.'}, | |
{ title : 'Alice', description : 'A story about Alice.'} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
exports.handler = function( event, context ){ | |
http.get({'host': 'api.ipify.org', 'port': 80, 'path': '/'}, function(resp) { | |
resp.on('data', function(ip) { | |
context.succeed(ip.toString()); | |
}); | |
resp.on('error', context.fail); | |
}); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var page = require('webpage').create(); | |
var click = function( selector, callback ){ | |
page.evaluate( function( selector ) { | |
var element = document.querySelector(selector); | |
var event = document.createEvent('MouseEvent'); | |
event.initEvent('click', true, true); | |
element.dispatchEvent(event); | |
return true; | |
}, selector ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var phantom = require('phantom'); | |
var debug = require('debug')('phantom'); | |
var p; | |
var click = function( selector, callback ){ | |
var self = this; | |
p.evaluate( function( selector ) { | |
var element = document.querySelector(selector); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This script finds "interesting words using Words API. | |
// https://www.wordsapi.com | |
var unirest = require('unirest'), | |
_ = require('underscore'), | |
async = require('async'), | |
fs = require('fs'); | |
// Results will be stored in the words object. | |
var words = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Dependencies | |
*/ | |
var fs = require('fs'), | |
request = require('request'), | |
cp = require('child_process'), | |
spawn = cp.spawn; | |
var image = request("http://medpreps.com/wp-content/uploads/2012/05/cma-practice-test.jpg"); | |
var wm = request("https://github.com/linse/Gibberbot/diff_blob/f096f6d94b3fb745975ea5f61f5a43b47098598b/res/drawable/droid_watermark.png?raw=true"); |
NewerOlder