AVVERTIMENTO: Tutti i frammenti di codice presenti in questo aritcolo non sono in nessun particolare linguaggio ma sono verosimili (vd. Manzoni).
WIP: Work In Progress, non leggere le cose contrassegnate con questo
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
| MIT License | |
| Copyright (c) 2017 Antonio De Lucreziis | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
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
| MIT License | |
| Copyright (c) 2017 Antonio De Lucreziis | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
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
| MIT License | |
| Copyright (c) 2017 Antonio De Lucreziis | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
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
| class BasicScanner(val source: String, var carret: Int = 0) { | |
| fun jumpAll(predicate: (Char) -> Boolean): String { | |
| return StringBuilder().apply { | |
| var current = seeNextChar() | |
| while (predicate(current)) { | |
| append(current) | |
| carret++ | |
| if (hasMore()) | |
| current = seeNextChar() |
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
| function fromTemplate(templateId, data) { | |
| data = data || {}; | |
| const templateCode = $('#' + templateId).html(); | |
| const compiledTemplate = templateCode | |
| .replace(/\{\{(.+?)\}\}/g, function (match, code) { | |
| return (function() { | |
| return eval(code); | |
| }.bind(data)()); |
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
| /** | |
| * Created by aziis98 on 29/11/2016. | |
| * Copyright 2016 Antonio De Lucreziis | |
| */ | |
| fun <T> split(source: List<T>, predicate: (T, T) -> Boolean): List<List<T>> { | |
| fun _split(predicate: (T, T) -> Boolean, acc: List<List<T>>, source: List<T>): Pair<List<List<T>>, List<T>> { | |
| if (acc.isEmpty()) { | |
| val a = source[0] | |
| val b = source[1] |
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
| /* | |
| A small library that adds a template engine and a one way binding mechanism. All in 200 lines of code. | |
| */ |