Skip to content

Instantly share code, notes, and snippets.

View jgwill's full-sized avatar

Guillaume Descoteaux-Isabelle jgwill

View GitHub Profile
//@cr A File URL is posted to the CHAT in the Resolution Field and the server render the content to the browser with the file content
var fetch = require('isomorphic-fetch'); // or another library of choice.
var fs = require('fs');
var Dropbox = require('dropbox').Dropbox;
var token = process.env.DROPBOX_TOKEN;
var dbx = new Dropbox({ accessToken: token, fetch: fetch });
var annoter_file = "9c6a35efe357580f32e759908430643d.annoter.txt";
var annoter_folder_path = '/x/_/_db/annoter';
var annoter_file_path = annoter_folder_path + '/' + annoter_file;
@jgwill
jgwill / x-markdown-handlebars-helpers-example.js
Created April 15, 2019 21:56
@stcgoal That we can use Markdown into Templates data that will be rendered as HTML
//import
var h = require('handlebars');
//@stcgoal That we can use Markdown into Templates data that will be rendered as HTML
h.registerHelper('markdown', require('helper-markdown'));
//-------------------------------------------
//@STCGoal Use Markdown in your Code to Render it as HTML
@jgwill
jgwill / x-helper-handlebars-example.js
Last active April 15, 2019 20:26
Register an Helper for the Handlebars rendering
//import
var h = require('handlebars');
//Register an Helper for the Handlebars rendering
h.registerHelper('list',function(items,options)
{
var out = `
<table>
<tr><td>Name</td><td>Note</td></tr>`;
items.forEach(element => {
@jgwill
jgwill / Mastery-HandleBars.md
Last active April 15, 2019 19:38
Mastery HandleBars - NodeJS

Mastery HandleBars

Simple Handlebars example

//import
var h = require('handlebars');

//Handlebars sources
var code = `
@jgwill
jgwill / x-translating-using-google-translate-api.js
Last active April 11, 2019 12:01
Simple Translation using Google Translate API and NodeJS
//Install require an env var with your API keys
//export GOOGLE_APPLICATION_CREDENTIALS="/home/jgi/x/etc/mykeys-5oeu3uoeu.json"
// Imports the Google Cloud client library
const {Translate} = require('@google-cloud/translate');
// Instantiates a client
const translate = new Translate({
});
@jgwill
jgwill / dummy.json
Last active April 11, 2019 11:53
@stcgoal Optimal Management of JSON Files
{
"name": "transapp",
"version": "0.0.1",
"description": "Master the Translate API to create. string Hello world is adde to each lang located in the i18n directory using the translator",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "Guillaume Isabelle",
@jgwill
jgwill / angular-assets-copying-from-node_modules.json
Created April 10, 2019 02:42
When you want to copy files into assets at compile time in angular Assets
"assets": [
"src/favicon.ico",
{
"glob": "*.svg",
"input": "./node_modules/country-icons/Markup/blocks/lng/i/",
"output": "assets/i18n.icon/"
},
"src/assets",
"src/assets/i18n"
],
@jgwill
jgwill / firebase-x-create-token.js
Created April 1, 2019 20:48
Creates a JSON Token from a UID for connecting to Firebase.
/**
* Creates a JSON Token from a UID for connecting to Firebase.
*/
const config = require('./config');
// The Firebase Admin SDK to access the Firebase Realtime Database.
const admin = require('firebase-admin');
#!/bin/bash
NOBLANK="
@xset s noblank
@xset s off
@xset -dpms
"
# Pretty ANSI text colors
OFF="\033[0m"
#!/bin/bash
NOBLANK="
@xset s noblank
@xset s off
@xset -dpms
"
# Pretty ANSI text colors
OFF="\033[0m"