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
diff --git a/lexer/src/lib.rs b/lexer/src/lib.rs | |
index 45d6b38..88495f9 100644 | |
--- a/lexer/src/lib.rs | |
+++ b/lexer/src/lib.rs | |
@@ -163,11 +163,22 @@ where I: Iterator<Item = char>, | |
// matches constructs beginning with a digit, e.g. 0.123 or 10e+42 | |
fn digit(&mut self) -> Result<TokenType, LexError> { | |
let mut s = String::new(); | |
+ // is digit 0 | |
+ // is the next thing x |
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
function formatNumber(number) { | |
let format = []; | |
let num = parseFloat(number); | |
let decimal = (Math.abs(num) % 1).toString().slice(0,4); | |
let isNegative = parseInt(num) < 0; | |
let hasDecimal = number.indexOf('.') !== -1; | |
if (isNegative) { | |
format.push('-'); | |
} |
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 Main { | |
public static void main(String[] args) { | |
Main.func("Hello world!"); | |
} | |
public static void func(String str) { | |
String output = ""; | |
for (int i = 0; i < str.length(); i++) { | |
char character = str.charAt(i); | |
if (output.indexOf(character) == -1){ |
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
((function (global) { | |
class A { | |
constructor() { | |
console.log('soy clase A'); | |
} | |
} | |
global.A = A; | |
}(this)); |
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
export class Animal { | |
constructor(name) { | |
this.name = name; | |
} | |
print() { | |
console.log(`Soy animal del tipo ${this.name}`); | |
} | |
} | |
export class Oso extends Animal { |
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
// mutators | |
// push , pop, shift, unshift | |
var array = []; | |
/ | |
function memoria(limit) { | |
var array = []; | |
return function (element) { | |
var isSet = arguments.length >= 1; | |
if (isSet) { | |
array.push(element) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div id="container"></div> | |
</body> |
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 arr = ['a', 'b', 'c']; | |
const iterador = arr[Symbol.iterator](); | |
iterador.next(); | |
// { value: 'a', done: false } | |
iterador.next(); | |
// { value: 'b', done: false } | |
iterador.next(); | |
// { value: undefined, done: true } | |
/// Only for linear data strutures |
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
(function() { | |
var CSS_CLASS_DELIM, QuickdrawError, VirtualDomNode, dispatchEvent, exports, qd, qdInternal, | |
slice = [].slice, | |
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, | |
hasProp = {}.hasOwnProperty; | |
qd = {}; | |
if (typeof window !== "undefined" && window !== null) { | |
if (window.qd != null) { |
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
// Promesas (Promises) ES6 | |
// XHR request XMLHttpRequest | |
// cross domain request | |
// https://www.mocky.io/ | |
function request(url){ | |
return new Promise((resolve, reject) => { | |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', url); |