Skip to content

Instantly share code, notes, and snippets.

View amegabosco's full-sized avatar

amegabosco

  • SMILEUPPS-3213AF4224
View GitHub Profile
@amegabosco
amegabosco / GDrive.Upload.ps1
Created December 2, 2022 12:39 — forked from ConnorGriffin/GDrive.Upload.ps1
GDrive Upload PowerShell Script
# Set the Google Auth parameters. Fill in your RefreshToken, ClientID, and ClientSecret
$params = @{
Uri = 'https://accounts.google.com/o/oauth2/token'
Body = @(
"refresh_token=$RefreshToken", # Replace $RefreshToken with your refresh token
"client_id=$ClientID", # Replace $ClientID with your client ID
"client_secret=$ClientSecret", # Replace $ClientSecret with your client secret
"grant_type=refresh_token"
) -join '&'
Method = 'Post'
@amegabosco
amegabosco / communes_togo.json
Created May 29, 2022 18:43
geojson of Togo communes
[
{
"ID_0": "Centre",
"COUNTRY": "",
"NAME_1": "Blitta",
"NL_NAME_1": "",
"NAME_2": "TGO.1.1.1_1",
"NL_NAME_2": "Agbandi",
"ID_3": "",
"NAME_3": "",
@amegabosco
amegabosco / console_save.js
Created May 29, 2022 18:37
pour telecharger le resultat d'un objet de la console . a lancer dans la console.
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
}
if(!filename) filename = 'console.json'
// get the content
@ob_start();
$writer = PHPExcel_IOFactory::createWriter($excel, "Excel2007");
$writer->save("php://output");
$data = @ob_get_contents();
@ob_end_clean();
// set email attachment
@amegabosco
amegabosco / resumableUpload.js
Created March 16, 2022 08:52 — forked from dam1/resumableUpload.js
Resumable Upload Google Drive Api - Node Js
var fs = require('fs');
var request = require('request');
var EventEmitter = require('events').EventEmitter;
var mime = require('mime');
var util = require('util');
function resumableUpload() {
this.byteCount = 0; //init variables
this.tokens = {};
this.filepath = '';
@amegabosco
amegabosco / consoleColors.js
Created November 29, 2021 14:32 — forked from abritinthebay/consoleColors.js
The various escape codes you can use to color output to StdOut from Node JS
// Colors reference
// You can use the following as so:
// console.log(colorCode, data);
// console.log(`${colorCode}some colorful text string${resetCode} rest of string in normal color`);
//
// ... and so on.
export const reset = "\x1b[0m"
export const bright = "\x1b[1m"
export const dim = "\x1b[2m"
@amegabosco
amegabosco / class.couchdb.php
Created December 12, 2017 13:08 — forked from p2k/class.couchdb.php
PHP class for easy use of CouchDB databases
<?php
/*
* class.couchdb.php - A class for easy use of CouchDB databases in PHP
*
* Copyright (C) 2012 Patrick "p2k" Schneider <[email protected]>
*
* This is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or