Skip to content

Instantly share code, notes, and snippets.

View linglung's full-sized avatar

linglung

  • C+ Java
View GitHub Profile
@rheajt
rheajt / Code.gs
Created August 1, 2017 08:16
examples of simple triggers with google apps script
/**
* These simple triggers are available in Sheets, Docs, and Forms
* Most of this information can be found:
* https://developers.google.com/apps-script/guides/triggers/events
*/
function onOpen(e) {
// {
// authMode: 'LIMITED',
// source: 'Spreadsheet' || 'Document' || 'Form',
// user: 'User'
unit Unit4;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.StdCtrls,
FMX.Controls.Presentation, FMX.ScrollBox, FMX.Memo;
type
@KenDUemura
KenDUemura / getTableByXpath.gs
Last active October 19, 2020 03:39
Google Apps Script for parse table element from HTML string parsed with XmlService and returns 2D array
/*
PARAMS:
text XML (In this gist, namespace needs to be 'http://www.w3.org/1999/xhtml')
path XPATH (So far tested with simple indexed lookup /html/body/table[3])
RETURNS:
Array[][] (Table data)
Missing th/thead/tfoot support
*/
@geuis
geuis / gist:8b1b2ea57d7f9a9ae22f80d4fbf5b97f
Last active January 10, 2024 16:43
Get Youtube video urls
// Run from the dev tools console of any Youtube video
// Accurate as of July 2, 2020.
//
// Copy and paste this into the dev console in a browser with the desired video loaded.
//
// NOTE: Some Youtube videos do not directly expose the video url in the response.
// This script doesn't currently attempt to handle those. It will work for most other general video types though.
(async () => {
const html = await fetch(window.location.href).then((resp) => resp.text()).then((text) => text);
for src in *flac; do
dst="$(echo $src | sed -e 's/\.flac//' -e 's/ /_/g')".mp3
ffmpeg -i "$src" -ab 320k "$dst"
operon clear -a "$dst"
operon copy "$src" "$dst"
done
#!/bin/bash
# Anh Nguyen <[email protected]>
# 2016-04-30
# MIT License
# This script takes in same-size images from a folder and make a crossfade video from the images using ffmpeg.
# Make sure you have ffmpeg installed before running.
# The output command looks something like the below, but for as many images as you have in the folder.
@MauricioMoraes
MauricioMoraes / one_level_flatten.js
Created October 22, 2015 12:00
Javascript Flatten (for one level nested arrays) - Useful for google apps scripts on spreadsheets
// Takes and array of arrays matrix and return an array of elements.
function flatten(arrayOfArrays){
return [].concat.apply([], arrayOfArrays);
}
@ociredefz
ociredefz / google-script-add-fonts.gs
Created July 4, 2015 18:45
Google apps script to set different fonts in the sheets.
/**
* Google Script - Add Fonts.
* Add other fonts in Google Spreadsheet.
*
* a) Open 'Script editor'
* b) Add this script
* c) Save and run 'onOpen'
* d) Go to some 'Spreadsheet' project
* e) Click to 'Font Editor' and then to 'Change Font'
*/
@dgp
dgp / youtube api video category id list
Created June 11, 2015 05:57
youtube api video category id list
2 - Autos & Vehicles
1 - Film & Animation
10 - Music
15 - Pets & Animals
17 - Sports
18 - Short Movies
19 - Travel & Events
20 - Gaming
21 - Videoblogging
22 - People & Blogs
@chipoglesby
chipoglesby / conditional-formatting.js
Last active May 18, 2022 23:34
Conditional Formatting in Google App Script based on cell value
//If the current cell is more than the previous cell, set it as lime green
function onEdit(e) {
var ss = SpreadsheetApp.getActive();
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var name = sheet.getName();
var range = sheet.getRange("A:J");
var values = range.getValues();
var cell = sheet.getActiveCell();
var value = cell.getValue();