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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>GLTFLoader example</title> | |
<style> | |
body { margin: 0; overflow: hidden;} | |
</style> | |
</head> | |
<body> |
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
// from https://stackoverflow.com/a/46049763 | |
import Foundation | |
struct JSONCodingKeys: CodingKey { | |
var stringValue: String | |
init?(stringValue: String) { | |
self.stringValue = stringValue | |
} |
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 ( | |
"fmt" | |
"time" | |
) | |
type Point struct { | |
x int | |
y int |
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
import Foundation | |
let stdin = FileHandle.standardInput | |
var term = termios() | |
tcgetattr(stdin.fileDescriptor, &term) | |
term.c_lflag &= ~(UInt(ECHO | ICANON)) // Noecho & Noncanonical | |
tcsetattr(stdin.fileDescriptor, TCSAFLUSH, &term); |
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
use std::collections::HashSet; | |
use std::io::{self, stdout, Write}; | |
type Point = (i8, i8); | |
type Board = HashSet<(i8, i8)>; | |
fn neighbors(point: Point) -> [Point; 8] { | |
let (x, y) = point; | |
[ | |
(x + 1, y), |
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
defmodule LifeGame do | |
def advance(board) do | |
board |> neighbors_all |> MapSet.to_list |> Enum.filter(&living?(&1, board)) |> MapSet.new | |
end | |
defp living?(point, board) do | |
count = point |> neighbors |> Enum.count(&MapSet.member?(board, &1)) | |
count == 3 || (MapSet.member?(board, point) && count == 2) | |
end |
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
use std::fs; | |
use std::io::{BufWriter, Write}; | |
extern crate reqwest; | |
extern crate scraper; | |
use scraper::{Html, Selector}; | |
extern crate encoding; | |
use encoding::all::EUC_JP; | |
use encoding::{DecoderTrap, Encoding}; |
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
// swift-tools-version:5.0 | |
// The swift-tools-version declares the minimum version of Swift required to build this package. | |
import PackageDescription | |
let package = Package( | |
name: "SoundIOSample", | |
products: [ | |
.executable( | |
name: "SoundIODemo", | |
targets: ["SoundIODemo"]), |
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
import Foundation | |
let height = 30 | |
let width = 60 | |
struct Point : Hashable { | |
var x: Int | |
var y: Int | |
} |
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
require 'set' | |
def neighbors(point) | |
return to_enum(:neighbors, point).to_a unless block_given? | |
x, y = point | |
yield [x + 1, y] | |
yield [x - 1, y] | |
yield [x, y + 1] | |
yield [x, y - 1] | |
yield [x + 1, y + 1] |
NewerOlder