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 sys | |
import io | |
import os | |
import traceback | |
from wand.image import Image as WandImage | |
from wand.color import Color | |
from PIL import Image | |
IMAGE_WIDTH = 800 | |
IMAGE_HEIGHT = 480 |
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
require "aws-sdk" | |
require_relative "errors" | |
class S3Uploader | |
AWS_ACCESS_KEY = ENV["AWS_ACCESS_KEY"] | |
AWS_SECRET_KEY = ENV["AWS_SECRET_KEY"] | |
AWS_BUCKET_NAME = ENV["AWS_BUCKET_NAME"] | |
AWS_REGION = ENV["AWS_REGION"] || "us-east-1" | |
AWS_FILE_PREFIX = ENV["AWS_FILE_PREFIX"] || "bm" |
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
func queryForDevices() { | |
let rPi = URL(string: "http://10.3.141.1:8080/devices")! | |
let task = URLSession.shared.dataTask(with: rPi) {(data, response, error) in | |
guard let data = data else { return } | |
print(String(data: data, encoding: .utf8)!) | |
} | |
task.resume() | |
} |
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" | |
"net/http" | |
"io/ioutil" | |
) | |
func main() { | |
http.HandleFunc("/devices", HandleDeviceRequest) |
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
using System.Collections.Generic; | |
using UnityEngine.Windows.Speech; | |
using System.Linq; | |
public class PhraseRecognitionExample : MonoBehaviour | |
{ | |
// Holds all of the keywords and their actions | |
Dictionary<string, System.Action> keywords = new Dictionary<string, System.Action>(); | |
// Called before the first frame update |
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
echo "Updating certbot..." | |
sudo apt-get update | |
sudo apt-get install software-properties-common | |
sudo add-apt-repository universe | |
sudo add-apt-repository ppa:certbot/certbot | |
sudo apt-get update | |
sudo apt-get install certbot python-certbot-apache | |
echo "Printing version..." | |
certbot --version |
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
// | |
// | |
// Adapted from: | |
// | |
// Original: https://gist.github.com/loudmouth/332e8d89d8de2c1eaf81875cfcd22e24 | |
// Adds encoding: https://github.com/3D4Medical/glTFSceneKit/blob/master/Sources/glTFSceneKit/GLTF/JSONCodingKeys.swift | |
// Adds fix for null inside arrays causing infinite loop: https://gist.github.com/loudmouth/332e8d89d8de2c1eaf81875cfcd22e24#gistcomment-2807855 | |
// | |
struct JSONCodingKeys: CodingKey { | |
var stringValue: String |
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
class MathHelper { | |
lazy var pi: Double = { | |
// Calculate pi to a crazy number of digits | |
return resultOfCalculation | |
}() | |
} |
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
class Person { | |
var name: String | |
lazy var personalizedGreeting: String = { | |
return "Hello, \(self.name)!" | |
}() | |
init(name: String) { | |
self.name = name | |
} |
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
class TestClass { | |
lazy var players = TestClass.initialPlayers() | |
class func initialPlayers() -> [String] { | |
var players = ["John Doe"] | |
return players | |
} | |
} |
NewerOlder