Skip to content

Instantly share code, notes, and snippets.

let
Used to associate, or bind, a name to a value or function.
Error opening binary file 'C:\Program Files\dotnet\shared/Microsoft.NETCore.App\3.1.1\Microsoft.DiaSymReader.Native.amd64.dll': C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.1\Microsoft.DiaSymReader.Native.amd64.dll: bad cli header, rva 0F# Compiler(229)
Problem reading assembly 'C:\Program Files\dotnet\shared/Microsoft.NETCore.App\3.1.1\Microsoft.DiaSymReader.Native.amd64.dll': The exception has been reported. This internal exception should now be caught at an error recovery point on the stack. Original message: Error opening binary file 'C:\Program Files\dotnet\shared/Microsoft.NETCore.App\3.1.1\Microsoft.DiaSymReader.Native.amd64.dll': C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.1\Microsoft.DiaSymReader.Native.amd64.dll: bad cli header, rva 0)F# Compiler(3160)
Error opening binary file 'C:\Program Files\dotnet\shared/Microsoft.NETCore.App\3.1.1\api-ms-win-core-console-l1-1-0.dll': C:\Program Files\dotnet\shared\Microsof
async function getLoggedInEmail() {
return new Promise((resolve, reject) => {
try {
// header element works on gmail
// .ongoogle-material-minibar works on slides UI
let header = document.querySelector('header');
if (header === null) {
// Try mini-bar
header = document.querySelector('.onegoogle-material-minibar')
/**
* https://stackoverflow.com/questions/37098405/javascript-queryselector-find-div-by-innertext
* https://developers.google.com/gsuite/add-ons/concepts/menus
* https://stackoverflow.com/questions/51848258/google-docs-programmatically-send-mouse-click-to-an-item-in-outline-pane
* https://stackoverflow.com/a/43331339/209
*
* */
var simulateMouseEvent = function(element, eventName, coordX, coordY) {
import csv
import io
class CsvDownloadHandler(handlers.BaseAjaxHandler):
# TODO, POST instead of GET to avoid XSSI prefixes
def get(self):
self.response.headers['Content-Type'] = 'application/csv'
self.response.headers["Content-Disposition"] = 'attachment; filename="%s"' % 'all-sessions.csv'
@CVertex
CVertex / diff.py
Created November 21, 2018 23:59
Playing around with difflib module in python 2.7
import difflib
a = """
one
two
three
four
"""
b = """
python -c 'import BaseHTTPServer as bhs, SimpleHTTPServer as shs; bhs.HTTPServer(("127.0.0.1", 3027), shs.SimpleHTTPRequestHandler).serve_forever()'
@CVertex
CVertex / discriminated_union.ts
Created August 25, 2018 12:42
Discriminated Union TypeScript example using instanceof. It's nice for web APIs
class Video {
id: number;
constructor(id: number) {
this.id = id;
}
}
class Error {
message: string;
@CVertex
CVertex / Google-Sheet-Form-Post.md
Created July 9, 2017 04:25 — forked from willpatera/Google-Sheet-Form-Post.md
Post to google spreadsheet from html form

Overview

This collection of files serves as a simple static demonstration of how to post to a google spreadsheet from an external html <form> following the example by Martin Hawksey

Run example

You should be able to just open index.html in your browser and test locally.

However if there are some permissions errors you can make a quick html server with python. Open terminal and cd to the directory where the gist files are located and enter python -m SimpleHTTPServer. By default this creates a local server at localhost:8000

@CVertex
CVertex / Storage.ts
Created January 3, 2017 06:36
Storage Typescript adapter layer. Use localStorage when useable, otherwise cookies
namespace Util {
// Contract for storage
export interface Storage {
getItem(key: string): any;
removeItem(key: string): void;
setItem(key: string, data: string): void;
}
// Borrowed from https://gist.github.com/wittnl/2890870
@CVertex
CVertex / Interval.cs
Created November 23, 2016 06:44 — forked from hongymagic/Interval.cs
Representing Intervals in C# with Generics support `Interval<T>`
using System;
namespace Hongy
{
/// <summary>
/// Represents vectorless interval of the form [a, b] or (a, b) or any
/// combination of exclusive and inclusive end points.
/// </summary>
/// <typeparam name="T">Any comparent type</typeparam>
/// <remarks>