Instantly share code, notes, and snippets.

View listGmailLabels.js
function myFunction() {
var labels = GmailApp.getUserLabels();
labels[0].getName()
var sortedLabels = labels.sort(function (label1, label2) {
var a = label1.getName().toLowerCase();
var b = label2.getName().toLowerCase();
if(a < b) { return -1; }
if(a > b) { return 1; }
return 0;
})
View saxophone.js
var PRESENTATION_TITLE = 'Saxophone Tutorials';
var YOUTUBE_QUERY = 'saxophone tutorials';
/**
* Gets a list of YouTube videos.
* @param {String} query - The query term to search for.
* @ref https://developers.google.com/youtube/v3/docs/search/list
*/
function getYouTubeVideosJSON(query) {
var youTubeResults = YouTube.Search.list('id,snippet', {
View clasp.ts
var ts = require('typescript');
var t = ts.transpile(s, {
compilerOptions: {
strict: true,
lib: ["es2015"],
}
});
console.log(t);
View cal.js
var fs = require('fs');
var readline = require('readline');
var google = require('googleapis');
var googleAuth = require('google-auth-library');
// If modifying these scopes, delete your previously saved credentials
// at ~/.credentials/calendar-nodejs-quickstart.json
var SCOPES = ['https://www.googleapis.com/auth/calendar.readonly'];
var TOKEN_PATH = 'creds.json';
View TestGoogleAPIs.go
package snippets
import (
"testing"
"github.com/stretchr/testify/assert"
"net/http"
"time"
"encoding/json"
"log"
"fmt"
View quickstart.go
package main
import (
"fmt"
"log"
)
// https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit
var SpreadsheetId = "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"
View MusicXML.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE score-partwise
PUBLIC '-//Recordare//DTD MusicXML 2.0 Partwise//EN'
'http://www.musicxml.org/dtds/partwise.dtd'>
<score-partwise>
<work>
<work-number>BWV 784</work-number>
<work-title>Invention 13</work-title>
</work>
<identification>
View algoDBSearch.js
/**
* Searches the elastic search db.
* @param {String} query The raw text query
* @param {Callback} cb The response callback
* @return {Object} hits The hits from elasticsearch
*/
var search = function(query, cb) {
var url = ELASTIC_SEARCH_URL + 'algorithm/_search';
var body = {
query: {
View languages
--- 2007 ---
gamemaker
--- 2009 ---
actionscript
--- 2010 ---
html
css
javascript
--- 2011 ---
java
View keybase.md

Keybase proof

I hereby claim:

  • I am grant on github.
  • I am grant (https://keybase.io/grant) on keybase.
  • I have a public key whose fingerprint is 5DC1 0500 27DD 5A2F 423C 79A1 BA41 5BFE 5C8F 61A4

To claim this, I am signing this object: