Skip to content

Instantly share code, notes, and snippets.

View EcomGraduates's full-sized avatar
💬

EcomGraduates

💬
View GitHub Profile
@EcomGraduates
EcomGraduates / split-json.js
Created August 8, 2022 15:47 — forked from tlync/split-json.js
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) {
@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();
} );
} );
@EcomGraduates
EcomGraduates / google-calendar-event-insert-js
Created June 15, 2021 17:56 — forked from marchawkins/google-calendar-event-insert-js
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();