Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| package main | |
| import ( | |
| "runtime" | |
| "fmt" | |
| "time" | |
| ) | |
| func main() { | |
| // Print our starting memory usage (should be around 0mb) |
| 'use strict' | |
| const flatCache = require('flat-cache') | |
| module.exports = class Cache { | |
| constructor (name, path, cacheTime = 0) { | |
| this.name = name | |
| this.path = path | |
| this.cache = flatCache.load(name, path) | |
| this.expire = cacheTime === 0 ? false : cacheTime * 1000 * 60 |
| package main | |
| import ( | |
| "crypto/rand" | |
| "encoding/base64" | |
| "fmt" | |
| "io" | |
| "math/big" | |
| ) |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
| -- table.filter({"a", "b", "c", "d"}, function(o, k, i) return o >= "c" end) --> {"c","d"} | |
| -- | |
| -- @FGRibreau - Francois-Guillaume Ribreau | |
| -- @Redsmin - A full-feature client for Redis http://redsmin.com | |
| table.filter = function(t, filterIter) | |
| local out = {} | |
| for k, v in pairs(t) do | |
| if filterIter(v, k, t) then out[k] = v end | |
| end |