Tutorial by Examples

function createGoogleDriveTextFile() { var content,fileName,newFile;//Declare variable names fileName = "Test Doc " + new Date().toString().slice(0,15);//Create a new file name with date on end content = "This is the file Content"; newFile = DriveApp.createFile...
function createGoogleDriveFileWithBlob() { var blob,character,data,fileName,i,L,max,min,newFile,randomNmbr;//Declare variable names fileName = "Test Blob " + new Date().toString().slice(0,15);//Create a new file name with date on end L = 500;//Define how many times to loo...
function processGoogleDriveFolders() { var arrayAllFolderNames,continuationToken,folders,foldersFromToken,thisFolder;//Declare variable names arrayAllFolderNames = [];//Create an empty array and assign it to this variable name folders = DriveApp.getFolders();//Get all folders from ...
function processGoogleDriveFiles() { var arrayAllFileNames,continuationToken,files,filesFromToken,fileIterator,thisFile;//Declare variable names arrayAllFileNames = [];//Create an empty array and assign it to this variable name files = DriveApp.getFiles();//Get all files from Googl...
function DriveAppAddFolder(child) {//Adds file to the root drive in Google Drive var body,returnedFolder;//Declare variable names if (!child) { body = "There is no folder"; MailApp.sendEmail(Session.getEffectiveUser().getEmail(), "", "Error Adding Folder!&q...
function DriveAppAddFile(child) {//Adds file to the root drive in Google Drive var body,returnedFolder;//Declare variable names if (!child) { body = "There is no file"; MailApp.sendEmail(Session.getEffectiveUser().getEmail(), "", "Error Adding File!",...
Get all Google Forms with the word "Untitled" in the file name. function mainSearchFunction(searchStr) { var fileInfo,arrayFileIDs,arrayFileNames,arrayOfIndexNumbers, allFileIDsWithStringInName,i,searchStr,thisID;//Declare variables if (!searchStr) { searchStr = &quo...
example input: <html> <head> <title>the title</title> <link href='css/app.css' type='text/css' rel='stylesheet'> <script src='js/app.js'></script> </head> <body> <h1>header</h1> <div> &l...
Suppose we want to select a word without surrounding white spaces, use the text object iw for inner word using visual mode: Got to normal mode by pressing ESC Type viw at the beginning of a word This will select the inner word
In simple words: A Flyweight factory that for a given, already known, key will always give the same object as response. For new keys will create the instance and return it. Using the factory: ISomeFactory<string, object> factory = new FlyweightFactory<string, object>(); var result1...
In ASP.NET Core apps, you bundle and minify the client-side resources during design-time using third party tools, such as Gulp and Grunt. By using design-time bundling and minification, the minified files are created prior to the application’s deployment. Bundling and minifying before deployment p...
Visual Studio also features an available Bundler and Minifier Extension that is capable of handling this process for you. The extension allows you to easily select and bundle the files you need without writing a line of code. Building Your Bundles After installing the extension, you select all of ...
At its most basic level, Unit Testing in any language provides assertions against some known or expected output. function assert( outcome, description ) { var passFail = outcome ? 'pass' : 'fail'; console.log(passFail, ': ', description); return outcome; }; The popular assertio...
To run multiple processes e.g. an Apache web server together with an SSH daemon inside the same container you can use supervisord. Create your supervisord.conf configuration file like: [supervisord] nodaemon=true [program:sshd] command=/usr/sbin/sshd -D [program:apache2] command=/bin/bash...
uses System.Generics.Collections, { TArray } System.Generics.Defaults; { TComparer<T> } var StringArray: TArray<string>; { Also works with "array of string" } ... { Sorts the array case insensitive } TArray.Sort<string>(StringArray, TComparer<string>...
var List: TList<Integer>; ... List := TList<Integer>.Create; { Create List } try List.Add(100); { Add Items } List.Add(200); WriteLn(List[1]); { 200 } finally List.Free; end;
type TIntegerList = class(TList<Integer>) public function Sum: Integer; end; ... function TIntegerList.Sum: Integer; var Item: Integer; begin Result := 0; for Item in Self do Result := Result + Item; end;
Elm allows the definition of custom infix operators. Infix operators are defined using parenthesis around the name of a function. Consider this example of infix operator for construction Tuples 1 => True -- (1, True): (=>) : a -> b -> ( a, b ) (=>) a b = ( a, b ) Most of t...
To illustrate a simple example usage of the MVP pattern, consider the following code which creates a simple UI with only a button and a label. When the button is clicked, the label updates with the number of times the button has been clicked. We have 5 classes: Model - The POJO to maintain state...
Backbone models describe how data is stored using JavaScript objects. Each model is a hash of fields called attributes and the behaviour of the model including validation is described by options. A model of Todo item in a TodoApp would be var ToDo = Backbone.Model.extend({ defaults: { assi...

Page 544 of 1336