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
; com files are always loaded at 100h address | |
ORG 100h | |
start: ; make sure data segments and extra segments point | |
; to the same segment as the code, since this is a | |
; com app | |
MOV AX,CS | |
MOV DS,AX | |
MOV ES,AX |
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
[ | |
{ | |
"op": "add", | |
"path": "/builders/textures/-", | |
"value": { | |
"id": "lshape", | |
"name":"lshape", | |
"imageUrl": "https://picsum.photos/512", | |
"repeat":{"x":1,"y":1}, | |
"rotation": 3.14159 |
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
module InventoryItems(Command(..), Event(..), handle) where | |
import Data.Maybe(isJust) | |
type Id = String | |
type Name = String | |
type Amount = Int | |
data Command = CreateInventoryItem Id | |
| RenameInventoryItem Id 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
// Quick hack: Redirect to asset by URL - Endpoint extension for directus.io | |
// ========================================================================= | |
// | |
// 2021 - ToJans - Public Domain | |
// | |
// *** Don't hold me liable if it breaks anything! Quick hack, might expose all your data! | |
// | |
// You can use this endpoint extension to access assets via the folder and file structure | |
// you used in the file module, so you don't need to reference assets by guid anymore. | |
// |
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
window.d = 2; | |
Algebra(d,0,1,()=>{ | |
var point = (x,y)=>!(1e0 + x*1e1 + y*1e2), | |
// return functions instead of values, so they update when you drag the points | |
linesFromPoints = ps => ps.map((p,i,a) => ()=>p & (a[(i+1)%a.length]||a[0])), | |
pointsFromLines = e => e.map((ev,i,a) => ()=> ev * (a[(i+1)%a.length]||a[0])), |
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 CVector { | |
constructor(components = []) { this.components = components; } | |
get lengthSquared() { return this.components.reduce((p, c) => p + c * c); } | |
get length() { return Math.sqrt(this.lengthSquared); } | |
get normalized() { return new CVector(this.components.map(x => x / this.length)); } | |
get sum() { return Math.sum(this.components); } | |
add(other, missingComponentValue = 0) { return this._zip(other, (a, b) => a + b, missingComponentValue); } | |
sub(other, missingComponentValue = 0) { return this._zip(other, (a, b) => a - b, missingComponentValue); } | |
mul(other, missingComponentValue = 1) { return this._zip(other, (a, b) => a * b, missingComponentValue); } | |
div(other, missingComponentValue = 1) { return this._zip(other, (a, b) => a / b, missingComponentValue); } |
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
const TokenExpressions = { | |
comment: /^((\/\/[^\n]+)|(\/\*[^(\*\/)]+)\*\/)/, | |
strings: /^("(\\"|[^"])*")/, | |
multiline_strings: /^(`[^\`]+`)/, | |
whitespace: /^([\s\n\r]+)/, | |
brace: /^[\(\)]/, | |
curlyBrace: /^[\{\}]/, | |
array: /^[\[\]]/, | |
comma: /^\,/, | |
operator: /^(\+|-|\*|\/|=|>|<|>=|<=|&|\||%|!|\^|)/, |
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
Hello world! |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
/** | |
Chess: potential moves etc by @ToJans | |
Spiked in a couple of hours of late-night code for a tweet by @gregyoung | |
https://twitter.com/gregyoung/status/1385285718113722374 | |
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; | |
namespace FPExplained | |
{ | |
// This is a C# implementation showing what functors, applicatives and monads look like. | |
// | |
// ----><8----------------------------------- | |
// UPDATE: | |
// *********************************** | |
// For a maybe monad, all these constructs look a bit redundant; their reason of existance is more obvious |
NewerOlder