Skip to content

Instantly share code, notes, and snippets.

View EcomGraduates's full-sized avatar
💬

EcomGraduates

💬
View GitHub Profile
@EcomGraduates
EcomGraduates / upload-to-ftp.js
Created October 11, 2021 23:43 — forked from josemariagarcia95/upload-to-ftp.js
Code snippet to upload files to FTP server using Node.js
const Ftp = require( 'ftp' );
const ftpClient = new Ftp();
ftpClient.on( 'ready', function() {
ftpClient.put( './prueba.jpg', '/www/img/prueba.jpg', function( err, list ) {
if ( err ) throw err;
ftpClient.end();
} );
} );
@tanaikech
tanaikech / submit.md
Created January 5, 2021 06:59
Downloading and Uploading File to Google Drive without Saving File with Stream and Resumable Upload using Node.js

Downloading and Uploading File to Google Drive without Saving File with Stream and Resumable Upload using Node.js

This is a sample script of Node.js for downloading the data and uploading the data to Google Drive with the resumable upload without saving it as a file. The downloaded data is uploaded to Google Drive with the stream.

Sample script

Before you use this, please set the variables of accessToken, url, fileSize, mimeType and filename. In this case, fileSize is required to set because the data is uploaded with the resumable upload.

const request = require("request");
@tanaikech
tanaikech / submit.md
Last active October 29, 2023 01:46
Uploading Multiple Files From Local To Google Drive using Google Apps Script

Uploading Multiple Files From Local To Google Drive using Google Apps Script

This is a sample script for uploading multiple files from local PC to Google Drive using Google Apps Script. The dialog, sidebar and Web Apps can be used as the GUI interface.

Sample 1

In this sample, the following flow is run.

  1. Select files at browser.
  2. Upload the files every file.
  3. Save each file in Google Drive.
@marchawkins
marchawkins / google-calendar-event-insert-js
Last active January 14, 2022 18:55
How to connect to the Google Calendar API via the Javascript Client Library and insert an event into a (https://www.google.com/calendar/embed?src=gk0pudanag1bhu35vkv5dunja4%40group.calendar.google.com&ctz=America/New_York). The demo also employs Oauth2 authentication, so the script could read and write to a logged in user's calendar.
<div class="row">
<div class="col-md-2 col-sm-2 col-xs-12">
<button id="authorize-button" style="visibility: hidden" class="btn btn-primary">Authorize</button>
</div><!-- .col -->
<div class="col-md-10 col-sm-10 col-xs-12">
<script type="text/javascript">
// date variables
var now = new Date();
today = now.toISOString();
@tlync
tlync / split-json.js
Created September 1, 2012 06:08
Split large json file
if(process.argv.length < 3){
console.log('target file path is required.')
process.exit(1)
}
var target = process.argv[2]
console.log('file: ' + target)
var fs = require('fs')
fs.readFile(target, function (err, data) {