Skip to content

Instantly share code, notes, and snippets.

@max-te
max-te / youtube.js
Created September 17, 2012 15:56
Download Youtube-Video in node.js
var http = require('http')
var fs = require('fs')
var argv = require('optimist').argv
var rxVideoID = /v=([\]\[!"#$%'()*+,.\/:;<=>?@\^_`{|}~-\w]*)/
var link = argv._.toString()
var videoID = link.match(rxVideoID)[1]
http.get("http://www.youtube.com/get_video_info?video_id="+videoID, function(res) {
var chunks = []
@guidomb
guidomb / database.json
Last active May 23, 2019 15:54
Firebase database model example for a Twitter-like application
{
"users": {
"280598f1-e31e-4ced-845e-c8dd10e11ec3": {
"first_name": "Guido",
"last_name": "Marucci Blas",
"username": "guidomb",
"email": "guidomb@wolox.com.ar"
},
"280598f1-e31e-4ced-845e-c8dd10e11ad5": {
@rick4470
rick4470 / batch process.js
Last active March 12, 2023 15:36
How to Batch Process video conversions using FFMPEG with Node.js
const spawn = require('child_process').spawn;
const parent = process.argv[2];
let videos = [];
if(process.argv[2]){
// Parent Path
const start = parseInt(process.argv[3]);
const end = parseInt(process.argv[4]);
for (let i = start; i <= end; i++) {
videos.push(i);
@tanaikech
tanaikech / submit.md
Last active February 1, 2024 00:05
Uploading Files to OneDrive Using Node.js

In order to use this script, please retrieve client id, client secret and refresh token before. About this, you can see the detail information at https://gist.github.com/tanaikech/d9674f0ead7e3320c5e3184f5d1b05cc.

1. Simple item upload

This is for the simple item upload is available for items with less than 4 MB of content. The detail information is https://dev.onedrive.com/items/upload_put.htm.

var fs = require('fs');
var mime = require('mime');
var request = require('request');
@sturmenta
sturmenta / firestore2json.js
Last active October 28, 2022 19:03
firestore to json & json to firestore
const admin = require('firebase-admin');
const fs = require('fs');
const serviceAccount = require('../../../../../../Private/myschool-data_transfer-key.json');
admin.initializeApp({ credential: admin.credential.cert(serviceAccount) });
const schema = require('./schema').schema;
const firestore2json = (db, schema, current) => {