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
| { | |
| "type": "a.adminview", | |
| "path": "/timetable", | |
| "title": "@@Ocupación", | |
| "children": { | |
| "body": { | |
| "type": "dashboard", | |
| "children": [ | |
| { | |
| "type": "row", |
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
| /** | |
| * ------------------------------------------------------------------ | |
| * Compare and update the database with entity definitions. | |
| * ------------------------------------------------------------------ | |
| */ | |
| import "lib/std" | |
| import "lib/array" | |
| import * as config from "lib/config" | |
| import * as orm from "lib/orm"; |
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
| import "lib/std"; | |
| import * as web from "lib/web"; | |
| import * as orm from "lib/orm"; | |
| import * as crud from "lib/crud"; | |
| function init() { | |
| initEntities(); | |
| web.addRoute("/crm/clients.json", crud.listHandler("client"), [web.adminFilter]) | |
| web.addRoute("/crm/clients/:id.json", crud.detailHandler("client"), [web.adminFilter]) | |
| web.addRoute("/crm/saveClient.json", crud.saveHandler("client"), [web.adminFilter]) |
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
| namespace crm { | |
| window.addEventListener("load", () => { | |
| initRoutes(); | |
| }); | |
| function initRoutes() { | |
| web.addRoute("/crm/clients", clients) | |
| } | |
| function clients(data: any) { |
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
| /** | |
| * ------------------------------------------------------------------ * | |
| * Recursively enable/disable git repos | |
| * Poor man's submodules | |
| * ------------------------------------------------------------------ | |
| */ | |
| export function main(enabled: string) { | |
| let b = convert.toBool(enabled); | |
| processDir(".", b, true, os.fileSystem) |
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
| namespace web { | |
| let global = sync.newMutex(); | |
| let locks: Map<sync.Mutex> = <any>{} | |
| export function getLockedMutex(key: string): sync.Mutex { | |
| global.lock() | |
| try { | |
| let m = locks[key] | |
| if (!m) { |
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
| #!/bin/bash | |
| set -e | |
| cd githubliteide/build | |
| # -f first time install, clones the repo and prepares the build env. | |
| # -u update build | |
| # -k install original | |
| # |
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
| f, err := os.Open("access.log") | |
| if err != nil { | |
| panic(err) | |
| } | |
| defer f.Close() | |
| sc, err := files.NewBackScanner(f) | |
| if err != nil { | |
| panic(err) | |
| } |
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
| package files | |
| import ( | |
| "bytes" | |
| "os" | |
| ) | |
| func NewBackScanner(f *os.File) (*BackScanner, error) { | |
| s, err := f.Stat() | |
| if err != nil { |
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
| // Tail returns the last n lines of a file. It's not optimized but scans | |
| // from the end so it's fast for large files. | |
| func Tail(path string, lines int) ([]string, error) { | |
| f, err := os.Open(path) | |
| if err != nil { | |
| return nil, err | |
| } | |
| defer f.Close() | |
| s, err := os.Stat(path) |