Skip to content

Instantly share code, notes, and snippets.

# If you do not have OpenSSL installed, update
# the following line to use "http://" instead
source 'https://rubygems.org'
gem 'fron', git: 'https://github.com/digitalnatives/fron', ref: '8963f672aab4221b3a8d434ac75490cda606d164'
gem 'nostromo-ui', git: 'https://github.com/digitalnatives/nostromo-ui', branch: 'main'
gem 'quality_control', git: 'https://github.com/digitalnatives/quality-control'
gem 'haml', '>= 4.0.5'
gem 'middleman', '4.0.0.alpha.6'

※ Raspberry Pi RAID NAS Server Setup ※

Hardware:

  • Raspberry Pi 4 (4GB RAM)
  • Micro SD card 32GB
  • 2x Integral USB 3.1 flash drives 128GB

OS:

  • Raspbian Buster
## Parser
The parser has been spead up some thanks to @asterite #537 and it should parse
twice as fast and should consume half the memory in the general case.
## Type Checker
- Fixed a bug in scoping #529
## Language Server
@gdotdesign
gdotdesign / Main.mint
Created March 16, 2020 09:05
Mint media provider example.
component Main {
state mobile : Bool = false
use Provider.MediaQuery {
query = "(max-width: 1000px)",
changes =
(matches : Bool) : Promise(Never, Void) {
next { mobile = matches }
}
}
@gdotdesign
gdotdesign / cors.cr
Created February 10, 2020 15:03
Crystal Cors Handler
class Cors
include HTTP::Handler
getter origin : String
def initialize(@origin)
end
def call(context)
context.response.headers["Access-Control-Allow-Methods"] = "GET, PUT, POST, DELETE, LOAD, PATCH"
@gdotdesign
gdotdesign / Main.mint
Created February 9, 2020 14:52
Bulma Nav Toggle in Mint
component Main {
fun render : Html {
<div>
<a
role="button"
class="navbar-burger"
data-target="navMenu"
aria-label="menu"
aria-expanded="false">
@gdotdesign
gdotdesign / Counter.mint
Created July 28, 2018 11:25
State in 0.2
store Store {
state counter : Number = 0
fun increment : Void {
next { counter = counter + 1 }
}
fun decrement : Void {
next { counter = counter - 1 }
}
enum BarcodeScanner.Error {
Unkown
}
module BarcodeScanner {
fun scan : Promise(BarcodeScanner.Error, String) {
`
new Promise((resolve, reject) => {
cordova.plugins.barcodeScanner.scan((result) => {
resolve(result.text)
@gdotdesign
gdotdesign / WebSocket.mint
Last active March 19, 2020 21:38
WebSocket in Mint
record Provider.WebSocket.Subscription {
onOpen : Function(WebSocket, Promise(Never, Void)),
onMessage : Function(String, Promise(Never, Void)),
onError : Function(Promise(Never, Void)),
onClose : Function(Promise(Never, Void)),
url : String
}
provider Provider.WebSocket : Provider.WebSocket.Subscription {
fun open (url : String, socket : WebSocket) : Array(a) {
%YAML 1.2
---
name: Mint
file_extensions:
- mint
scope: source.mint
variables:
variable: '[a-z][A-Za-z_0-9]*'