Skip to content

Instantly share code, notes, and snippets.

View VishwaiOSDev's full-sized avatar
:octocat:
🌐 Hello, World!

Vishweshwaran Ravi VishwaiOSDev

:octocat:
🌐 Hello, World!
View GitHub Profile
@rin
rin / aws-lambda-youtube-dl.js
Created December 23, 2020 19:30
AWS Lambda to download youtube videos to S3
// To use this, put it in a folder, install ytdl-core with `npm i ytdl-core`, then create a ZIP with the content of the folder and deploy it.
// https://docs.aws.amazon.com/lambda/latest/dg/nodejs-package.html#nodejs-package-dependencies
var AWS = require('aws-sdk');
const ytdl = require('ytdl-core');
const stream = require('stream');
var s3 = new AWS.S3();
exports.handler = async (event, context, cb) => {
const { videoUrl, key, bucket } = event;
@ksmandersen
ksmandersen / URI+Helpers.swift
Created January 24, 2018 09:41
Appending query parameters to URI's in Vapor
extension URI {
public func appendingQueryParameters(_ parameters: [String: String]) -> URI {
let allParameters = mergeParameters(queryParameters(fromQuery: query), rhs: parameters)
let newQuery = toQuery(parameters: allParameters)
return URI(scheme: scheme, userInfo: userInfo, hostname: hostname, port: port, path: path,
query: newQuery, fragment: fragment)
}
private func toQuery(parameters: [String: String]) -> String {