Skip to content

Instantly share code, notes, and snippets.

Szikszai Gusztáv gdotdesign

Block or report user

Report or block gdotdesign

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Counter.mint
store Store {
state counter : Number = 0
fun increment : Void {
next { counter = counter + 1 }
}
fun decrement : Void {
next { counter = counter - 1 }
}
View gist:a0e203b6fc64ed1c9a646c5c27fe31af
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 Oct 8, 2018
WebSocket in Mint
View WebSocket.mint
record Provider.WebSocket.Subscription {
onOpen : Function(WebSocket, a),
onMessage : Function(String, a),
onError : Function(a),
onClose : Function(a),
url : String
}
provider Provider.WebSocket : Provider.WebSocket.Subscription {
fun open (url : String, socket : WebSocket) : Array(a) {
View Mint.sublime-syntax
%YAML 1.2
---
name: Mint
file_extensions:
- mint
scope: source.mint
variables:
variable: '[a-z][A-Za-z_0-9]*'
@gdotdesign
gdotdesign / Makefile
Created Oct 10, 2017
Foreman alternative using Make
View Makefile
target: run_backend run_frontend
start:
make -j2
run_frontend:
cd frontend && yarn live-server
run_backend:
cd backend && rails s
View DatePickers.elm
module Main exposing (..)
import Html exposing (div, span, strong, text)
import Date
import Time
import Debug
import Date.Extra.Format exposing (isoString)
import Ext.Date
@gdotdesign
gdotdesign / elm-make-bug
Created Jul 11, 2016
Windows script to reproduce an elm-make bug
View elm-make-bug
:loop
@echo off
rm -rf elm-make-bug
git clone git@github.com:gdotdesign/elm-make-bug.git > /dev/null 2>&1
cd elm-make-bug
elm-make Test.elm --yes > /dev/null 2>&1
perl -pi -e 's/A/B/g' Lib.elm
elm-make Test.elm --yes > /dev/null 2>&1
perl -pi -e 's/Lib.A/Lib.B/g' Bar.elm
elm-make Test.elm > /dev/null 2>&1
@gdotdesign
gdotdesign / elm-make-bug.sh
Created Jul 11, 2016
Script for testing an elm-make bug
View elm-make-bug.sh
#!/bin/bash
while true; do
rm -rf elm-make-bug
git clone git@github.com:gdotdesign/elm-make-bug.git > /dev/null 2>&1
cd elm-make-bug
elm-make Test.elm --yes > /dev/null 2>&1
perl -pi -e 's/A/B/g' Lib.elm
elm-make Test.elm --yes > /dev/null 2>&1
perl -pi -e 's/Lib.A/Lib.B/g' Bar.elm
View Dockerfile
FROM ubuntu:16.04
# Set Locale
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Setup
RUN apt-get update
@gdotdesign
gdotdesign / Main.elm
Last active May 26, 2016
Event handlers cannot be reattached after removing them.
View Main.elm
import Html exposing (..)
import Html.Events exposing (..)
import Html.Attributes exposing (..)
import Html.App as App
import String
type alias Model =
{ haveEvent : Bool
, text : String
You can’t perform that action at this time.