This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
hasPDFViewer.js | |
Version: 1.0.0 | |
Date: 2015-03-04 | |
(C) 2015 Alessandro Segala | |
License: BSD-2-Clause (http://opensource.org/licenses/BSD-2-Clause) | |
Original author: Ben Kitzelman (http://thecodeabode.blogspot.ca/2011/01/detect-adobe-reader-plugin.html) | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying my Blockstack ID is secured with the address 1FMZnTMBXeLHkfNBFA53v11tHqzASutxhN https://explorer.blockstack.org/address/1FMZnTMBXeLHkfNBFA53v11tHqzASutxhN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"context" | |
"crypto/x509" | |
"encoding/base64" | |
"encoding/pem" | |
"errors" | |
"fmt" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am italypaleale on github. | |
* I am italypaleale (https://keybase.io/italypaleale) on keybase. | |
* I have a public key ASDtXA-DxrP33br5E27v3z_iRXVJYektAvJw7uC5gGMlpgo | |
To claim this, I am signing this object: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The MIT License | |
Copyright (c) 2020, Alessandro Segala | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (C) 2020 Alessandro Segala (ItalyPaleAle) | |
// License: MIT | |
// MyGoFunc fetches an external resource by making a HTTP request from Go | |
// The JavaScript method accepts one argument, which is the URL to request | |
func MyGoFunc() js.Func { | |
return js.FuncOf(func(this js.Value, args []js.Value) interface{} { | |
// Get the URL as argument | |
// args[0] is a js.Value, so we need to get a string out of it | |
requestUrl := args[0].String() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (C) 2020 Alessandro Segala (ItalyPaleAle) | |
// License: MIT | |
// MyGoFunc fetches an external resource by making a HTTP request from Go | |
// The JavaScript method accepts one argument, which is the URL to request | |
func MyGoFunc() js.Func { | |
return js.FuncOf(func(this js.Value, args []js.Value) interface{} { | |
// Get the URL as argument | |
// args[0] is a js.Value, so we need to get a string out of it | |
requestUrl := args[0].String() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (C) 2020 Alessandro Segala (ItalyPaleAle) | |
// License: MIT | |
// MyGoFunc returns a Promise that fails with an exception about 50% of times | |
func MyGoFunc() js.Func { | |
return js.FuncOf(func(this js.Value, args []js.Value) interface{} { | |
// Handler for the Promise | |
handler := js.FuncOf(func(this js.Value, args []js.Value) interface{} { | |
resolve := args[0] | |
reject := args[1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (C) 2020 Alessandro Segala (ItalyPaleAle) | |
// License: MIT | |
// MyGoFunc returns a Promise that resolves after 3 seconds with a message | |
func MyGoFunc() js.Func { | |
return js.FuncOf(func(this js.Value, args []js.Value) interface{} { | |
// Handler for the Promise: this is a JS function | |
// It receives two arguments, which are JS functions themselves: resolve and reject | |
handler := js.FuncOf(func(this js.Value, args []js.Value) interface{} { | |
resolve := args[0] |
OlderNewer