rootspring / templater.ts
0 likes
0 forks
1 files
Last active
1 | import { builderVersion, Embed, TemplateBuilderData, TemplateBuilderDataComment } from "./types"; |
2 | |
3 | export const parseString = (s: string): string => { |
4 | // If it starts with $expr:, then it's a raw string |
5 | if (s.startsWith("$expr")) { |
6 | return s.substring(5).trim(); |
7 | } |
8 | |
9 | return `"${s}"`; |
10 | } |
rootspring / worker.rs
0 likes
0 forks
1 files
Last active
1 | // NOTE: Because the mlua crate is not Sync, we can use tokio spawn_local to run the Lua VM in an async context |
2 | // but pinned to a single thread |
3 | // |
4 | // This is highly experimental |
5 | pub struct LuaWorker { |
6 | /// A handle that allows stopping the VM inside its tokio localset |
7 | /// |
8 | /// This is wrapped in an option to allow destroying the handle when the LuaWorker is dropped |
9 | pub tx_stop: Option<tokio::sync::oneshot::Sender<()>>, |
10 | /// A channel used for sending requests to the VM |
rootspring / lua_usage.rs
0 likes
0 forks
1 files
Last active
1 | #[tokio::test] |
2 | async fn multilua_test() { |
3 | let vm1 = Lua::new(); |
4 | vm1.sandbox(true).unwrap(); |
5 | let vm2 = Lua::new(); |
6 | vm2.sandbox(true).unwrap(); |
7 | |
8 | // To allow locking down _G, we need to create a table to store user data (__stack) |
9 | vm1.globals() |
10 | .set("__stack", vm1.create_table().unwrap()) |
rootspring / lua_test.rs
0 likes
0 forks
1 files
Last active
1 | #[tokio::test] |
2 | async fn multilua_test() { |
3 | let mut vm1 = Lua::new(); |
4 | vm1.sandbox(false).unwrap(); |
5 | let mut vm2 = Lua::new(); |
6 | vm2.sandbox(false).unwrap(); |
7 | |
8 | // Set a global variable |
9 | let f: LuaFunction = vm1 |
10 | .load( |
rootspring / func.ts
0 likes
0 forks
1 files
Last active
1 | export interface DispatchType { |
2 | // The type of the input |
3 | type: string; |
4 | // The minimum length of the input |
5 | minlength: number | undefined; |
6 | // The maximum length of the input |
7 | maxlength: number | undefined; |
8 | // The allowed values of the input |
9 | allowed_values: { [label: string]: string } | undefined; |
10 | // If bitflag, then the values of the bitflag |
rootspring / migrate.go
0 likes
0 forks
1 files
Last active
1 | func ApplyMigrations() { |
2 | /* |
3 | webhooks.created_by TEXT NOT NULL [set unfilled to ''] |
4 | webhooks.last_updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() |
5 | webhooks.last_updated_by TEXT NOT NULL [set unfilled to ''] |
6 | |
7 | repos.created_by TEXT NOT NULL [set unfilled to ''] |
8 | repos.last_updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() |
9 | repos.last_updated_by TEXT NOT NULL [set unfilled to ''] |
rootspring / value.rs
0 likes
0 forks
1 files
Last active
1 | use sqlx::{postgres::PgRow, postgres::PgTypeKind, Column, Row, TypeInfo}; |
2 | use std::hash::{Hash, Hasher}; |
3 | |
4 | #[derive(Debug, Clone, PartialEq)] |
5 | #[allow(dead_code)] |
6 | /// Represents a supported value type |
7 | pub(crate) enum Value { |
8 | /// A uuid value |
9 | Uuid(sqlx::types::Uuid), |
rootspring / config_opts.rs
0 likes
0 forks
1 files
Last active
1 | #[derive(Debug, Clone, PartialEq)] |
2 | #[allow(dead_code)] |
3 | pub enum ColumnType { |
4 | String {}, |
5 | Integer {}, |
6 | BitFlag { |
7 | /// The bit flag values |
8 | values: indexmap::IndexMap<&'static str, u64>, |
9 | }, |
10 | Boolean {}, |
ranveersoni98 / gist:ba17226553074561acd7f55090682374
0 likes
0 forks
1 files
Last active
1 | import { useEffect, useState } from 'react'; |
2 | import UserPage from '@/components/Global/User'; |
3 | import { NextSeo } from "next-seo"; |
4 | |
5 | export default function UserProfilePage({ url }) { |
6 | const [userData, setUserData] = useState(null); |
7 | const apiUrl = process.env.NEXT_PUBLIC_API_URL; |
8 | |
9 | useEffect(() => { |
10 | const fetchData = async () => { |
ranveersoni98 / manifest.json
0 likes
0 forks
1 files
Last active
1 | { |
2 | "id": "1", |
3 | "display": "standalone", |
4 | "orientation": "portrait", |
5 | "theme_color": "#2c20f5", |
6 | "background_color": "2#c20f5", |
7 | "start_url": "/", |
8 | "name": "Topic Servers", |
9 | "short_name": "Topic", |
10 | "description": "Need more members? Not getting enough attention? Topic Servers is here for you.", |