This file contains 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 "fmt" | |
func main() { | |
fmt.Println("Hello, WebAssembly!") | |
} |
This file contains 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
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>WebAssembly with Go</title> | |
<body> | |
<h1>You've compiled Go for WebAssembly, Congratulations!</h1> | |
<script src="wasm_exec.js"></script> | |
<script> | |
const go = new Go(); | |
WebAssembly.instantiateStreaming( |
This file contains 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
// A basic HTTP server. | |
// By default, it serves the current working directory on port 8080. | |
package main | |
import ( | |
"flag" | |
"log" | |
"net/http" | |
) |
This file contains 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
import { Injectable } from '@angular/core'; | |
import * as CryptoJS from 'crypto-js'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class EncryptionService { | |
secretKey = "A secret key 123!"; | |
constructor() { } |
This file contains 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
import { TestBed } from '@angular/core/testing'; | |
import { EncryptionService } from './encryption.service'; | |
describe('EncryptionService', () => { | |
let service: EncryptionService; | |
beforeEach(() => { | |
TestBed.configureTestingModule({}); | |
service = TestBed.inject(EncryptionService); |
This file contains 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 | |
type device interface { | |
on() | |
off() | |
increaseVolume() | |
decreaseVolume() | |
} |
This file contains 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 | |
type command interface { | |
execute() | |
} |
This file contains 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 | |
type onCommand struct { | |
device device | |
} | |
func (c *onCommand) execute() { | |
c.device.on() | |
} |
This file contains 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 | |
type offCommand struct { | |
device device | |
} | |
func (c *offCommand) execute() { | |
c.device.off() | |
} |
This file contains 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 | |
type increaseVolumeCommand struct { | |
device device | |
} | |
func (c *increaseVolumeCommand) execute() { | |
c.device.increaseVolume() | |
} |
OlderNewer