Example of a webhook
server:
var http = require('http')
var express = require('express')
var bodyParser = require('body-parser')
var app = express()
// parses application/json
#!/bin/bash | |
curl -sSN http://ffmpeg.org/releases/ffmpeg-3.2.4.tar.bz2 | tar -xjf- | |
cd ffmpeg-3.2.4 | |
(./configure --help|head -n255|grep -- '--enable-'\ | |
| perl -pe's/.*(--enable-\S+).*/$1/g' | grep -v = # 255: toolchain options | |
./configure --list-encoders|perl -pe's/\s+/\n/g'|sed 's/^/--enable-encoder=/' | |
./configure --list-decoders|perl -pe's/\s+/\n/g'|sed 's/^/--enable-decoder=/' | |
./configure --list-hwaccels|perl -pe's/\s+/\n/g'|sed 's/^/--enable-hwaccel=/' | |
./configure --list-muxers|perl -pe's/\s+/\n/g'|sed 's/^/--enable-muxer=/' | |
./configure --list-demuxers|perl -pe's/\s+/\n/g'|sed 's/^/--enable-demuxer=/' |
var 🐢 = function(mstr){ | |
if (!mstr) mstr = {} | |
return function(config){ | |
for (var attr in config) { mstr[attr] = config[attr] } | |
var obj = scope(mstr) | |
obj.exec = function(){ | |
// awesome things here |
var expensiveThing = function(callback){ | |
setTimeout(function(){ | |
callback(null, { name: "Thurston Moore" }) | |
}, 5000) | |
} | |
var fetchAndLogExpensiveThing = function(){ | |
expensiveThing(function(err, data){ | |
console.log(err, data) |
Please review the following abuse complaint and provide us with a resolution: | |
****************************** | |
CloudFlare received a trademark infringement complaint regarding: | |
sharethesafety.org | |
Please be aware CloudFlare is a network provider offering a reverse proxy, pass-through security service. We are not a hosting provider. CloudFlare does not control the content of our customers. | |
The actual IP address hosting sharethesafety.org is 192.241.214.148. Using the following command, you can confirm the site in question is hosted at that IP address: curl -v -H "Host: sharethesafety.org" 192.241.214.148/ |
Example of a webhook
server:
var http = require('http')
var express = require('express')
var bodyParser = require('body-parser')
var app = express()
// parses application/json
global | |
maxconn 4096 | |
pidfile /Users/sintaxi/Documents/Node/Modules/pids/haproxy.pid | |
defaults | |
mode http | |
retries 3 | |
option redispatch | |
option httpclose | |
maxconn 2000 |
var fs = require("fs") | |
var request = require("request") | |
var filePath = __dirname + "/payload.tar.gz" | |
fs.createReadStream(filePath).pipe(request.put('http://api.lvh.me:3001/').pipe(process.stdout)) |
doctype | |
html | |
head | |
link(rel="stylesheet" href="/main.css") | |
body | |
ul | |
li(class="#{ current.source == 'index' ? 'active' : '' }") | |
a(href="/") Home | |
li(class="#{ current.source == 'about' ? 'active' : '' }") | |
a(href="/about") About |
var Transition = function(callback){ | |
this.instantOperations = [] | |
this.deferredOperations = [] | |
this.total = 0 | |
this.count = 0 | |
this.callback = callback || new Function() | |
return this; | |
} | |
Transition.prototype.add = function(el, args, cb){ |
var http = require('http') | |
var assert = require('assert') | |
var agent = require('superagent') | |
http.createServer(function (req, res) { | |
res.writeHead(500, {'Content-Type': 'text/plain'}) | |
res.end('Hello World\n') | |
}).listen(1337, '127.0.0.1', function(){ | |
agent.get('http://127.0.0.1:1337/').end(function(err, response){ | |
assert.equal(response.status, 500) |