Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexis MP alexismp

View GitHub Profile
View voeux.html
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Lecteur Ecard</title>
<link rel="stylesheet" href="https://www.cartesvirtuelles.fr/inc/css/reset.css">
<!-- <link rel="stylesheet" href="inc/css/styles.css?v--><!--">-->
@alexismp
alexismp / ffmpeg-trim.sh
Created Apr 16, 2020
trim beginning by 3 seconds
View ffmpeg-trim.sh
ffmpeg -i accompagnement.mkv -ss 3 -c copy accompagnement-trimmed.mkv
@alexismp
alexismp / ffmpeg-combine.sh
Last active Apr 16, 2020
ffmpeg combine two videos and audio into one
View ffmpeg-combine.sh
ffmpeg -i solo.mkv -i accompagnement-trimmed.mkv -filter_complex "[0:v][1:v]hstack=inputs=2[v]; [0:a][1:a]amerge[a]" -map "[v]" -map "[a]" -ac 2 valse-melanco.mkv
@alexismp
alexismp / index.js
Last active Dec 27, 2019
csv2sheet block and call functions
View index.js
const sheetId = await addEmptySheet(sheetsAPI, sheetName);
const theData = await readCSVContent(sheetsAPI, data, sheetName);
await populateAndStyle(sheetsAPI, theData, sheetId);
@alexismp
alexismp / index.js
Last active Jun 11, 2019
csv2sheet style headers
View index.js
function setColumnStyle(sheetsAPI, sheetId) {
return new Promise((resolve, reject) => {
const setStyleParams = {
spreadsheetId: process.env.SPREADSHEET_ID,
resource: {
requests: [
{
repeatCell: {
range: {
sheetId: sheetId,
@alexismp
alexismp / index.js
Last active May 8, 2020
csv2sheet populateAndStyle
View index.js
function populateAndStyle(sheetsAPI, theData, sheetId) {
return new Promise((resolve, reject) => {
// Using 'batchUpdate' allows for multiple 'requests' to be sent in a single batch.
// Populate the sheet referenced by its ID with the data received (a CSV string)
// Style: set first row font size to 11 and to Bold. Exercise left for the reader: resize columns
const dataAndStyle = {
spreadsheetId: process.env.SPREADSHEET_ID,
resource: {
requests: [
{
@alexismp
alexismp / index.js
Last active Jul 15, 2019
csv2sheet readCSVContent (assumes CSV content, no parsing)
View index.js
function readCSVContent(sheetsAPI, file, sheetName) {
return new Promise((resolve, reject) => {
const storage = new Storage();
let fileContents = new Buffer('');
let rows = [];
storage
.bucket(file.bucket)
.file(file.name)
.createReadStream()
.on("error", function(err) {
@alexismp
alexismp / index.js
Last active Jun 11, 2019
csv2sheet, addEmptySheet
View index.js
function addEmptySheet(sheetsAPI, sheetName) {
return new Promise((resolve, reject) => {
const emptySheetParams = {
spreadsheetId: process.env.SPREADSHEET_ID,
resource: {
requests: [
{
addSheet: {
properties: {
title: sheetName,
@alexismp
alexismp / index.js
Created Dec 28, 2018
Sheets API client
View index.js
const sheetsAPI = google.sheets({version: 'v4', auth});
@alexismp
alexismp / index.js
Last active Jun 11, 2019
csv2sheet auth
View index.js
const auth = await google.auth.getClient({
scopes: [
"https://www.googleapis.com/auth/spreadsheets",
"https://www.googleapis.com/auth/devstorage.read_only"
]
});