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 Lexer { | |
property tokens | |
property source | |
property pos | |
property buffer | |
func constructor() { | |
@tokens = [] | |
@token = null | |
@source = "" |
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
Array.methods.sort = ->{ | |
let sorted = @copy() | |
let left | |
let right | |
@length().times(func(i) { | |
(@length() - 1).times(func(y) { | |
left = sorted[i] |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<style media="screen"> | |
body * { | |
margin: 10px; | |
padding: 0; | |
display: block; |
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
const bytesInKilobyte = 1000 | |
const bytesInMegabyte = 1000000 | |
const bytesInGigabyte = 1000000000 | |
const bytesInTerabyte = 1000000000000 | |
function toHumanReadable(bytes) { | |
if (bytes >= bytesInTerabyte) return Math.round(bytes / bytesInTerabyte * 100) / 100 + " tb"; | |
if (bytes >= bytesInGigabyte) return Math.round(bytes / bytesInGigabyte * 100) / 100 + " gb"; | |
if (bytes >= bytesInMegabyte) return Math.round(bytes / bytesInMegabyte * 100) / 100 + " mb"; | |
if (bytes >= bytesInKilobyte) return Math.round(bytes / bytesInKilobyte * 100) / 100 + " kb"; |
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
// Source code: | |
// | |
// int a = 25 | |
// int b = 20 | |
// int c = 0; | |
// | |
// if (a + b > 40) { | |
// c = 1; | |
// } else { | |
// c = 0; |
OlderNewer