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
<?php | |
class CustomXenditHttpClient implements \Xendit\HttpClientInterface | |
{ | |
public function request($method, $uri, array $options = []) { | |
$client = new \GuzzleHttp\Client([ | |
'headers' => ['X-API-VERSION' => '2019-02-04'], | |
'base_uri' => \Xendit\Xendit::$apiBase, | |
]); | |
return $client->request($method, $uri, $options); |
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 mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
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
const awsServerlessExpress = require("aws-serverless-express"); | |
const app = require("./app"); | |
const server = awsServerlessExpress.createServer(app); | |
exports.handler = (event, context) => { | |
awsServerlessExpress.proxy(server, event, context); | |
} |
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
const app = require("./app"); | |
app.listen(process.env.PORT, () => { | |
console.log("App is running..."); | |
}); |
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
const express = require("express"); | |
const app = express(); | |
app.get("/hello", (req, res) => { | |
res.json({ | |
message: "Hello, World", | |
}); | |
}); | |
app.post("/ping", (req, res) => { |
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
const express = require("express"); | |
const app = express(); | |
app.get("/hello", (req, res) => { | |
res.json({ | |
message: "Hello, World", | |
}); | |
}); | |
app.post("/ping", (req, res) => { |
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
const express = require("express"); | |
const app = express(); | |
app.get("/hello", (req, res) => { | |
res.json({ | |
message: "Hello, World", | |
}); | |
}); | |
app.post("/ping", (req, res) => { |
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
const express = require('express'); | |
const app = express(); | |
const puppeteer = require('puppeteer'); | |
const ua = require("useragent"); | |
function isBot(userAgent) { | |
const agent = ua.is(userAgent); | |
return !agent.webkit && !agent.opera && !agent.ie && | |
!agent.chrome && !agent.safari && !agent.mobile_safari && | |
!agent.firefox && !agent.mozilla && !agent.android; |
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
package shortener | |
import ( | |
"strings" | |
) | |
var shortenerDict = `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789` // you can customize this, just make sure there's no duplicate chars | |
var shortenerBase = len(shortenerDict) | |
func ShortenID(ID int64) string { |
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
FROM debian:jessie | |
RUN apt-get update \ | |
&& apt-get install -y git nodejs php5-common php5-cli --no-install-recommends \ | |
&& rm -rf /var/lib/apt/lists/* | |
RUN npm install -g aglio | |
RUN git clone --recursive git://github.com/apiaryio/drafter.git \ | |
&& cd drafter \ |
NewerOlder