Skip to content

Instantly share code, notes, and snippets.

View ltanase77's full-sized avatar

Tanase Lucian ltanase77

View GitHub Profile
try {
$client = new Google_Client();
//$client->useApplicationDefaultCredentials();
$client->setAuthConfig(path/to/credentials_file);
$client->setApplicationName([appName]);
$client->addScope(Google_Service_Calendar::CALENDAR);
$client->setAccessType("offline");
$query = $this->files->get_file_by($file, "file_number");
@ltanase77
ltanase77 / FabricJs Dropdown + VueJs.WORD.yaml
Created August 31, 2019 12:31
Snippet for solving fabricjs problem in creating dynamic dropdown with vuejs
name: FabricJs Dropdown + VueJs
description: Snippet for solving fabricjs problem in creating dynamic dropdown with vuejs
host: WORD
api_set: {}
script:
content: "new Vue({\r\n el: \"#app\",\r\n data: {\r\n message: \"Hello Vue\",\r\n clausesEN: [],\r\n clausesRO: []\r\n },\r\n mounted: function() {\r\n var vm = this;\r\n return fetch(\"https://easy-clause.firebaseio.com/clauses-type.json\")\r\n .then(function(response) {\r\n return response.json();\r\n })\r\n .then(function(result) {\r\n console.log(result);\r\n vm.clausesEN = result.EN;\r\n vm.clausesRO = result.RO;\r\n vm.$nextTick(function() {\r\n var DropdownHTMLElements = document.querySelectorAll(\".ms-Dropdown\");\r\n for (var i = 0; i < DropdownHTMLElements.length; ++i) {\r\n new fabric[\"Dropdown\"](DropdownHTMLElements[i]);\r\n }\r\n });\r\n })\r\n .catch(function(error) {\r\n console.log(error);\r\n });\r\n },\