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 {}, |
rootspring / getguildbase.go
0 likes
0 forks
1 files
Last active
1 | package get_user_guild_base_info |
2 | |
3 | import ( |
4 | "errors" |
5 | "net/http" |
6 | "time" |
7 | |
8 | "github.com/anti-raid/splashtail/animusmagic" |
9 | "github.com/anti-raid/splashtail/types" |
10 | "github.com/anti-raid/splashtail/utils" |
rootspring / permoverwrites.go
0 likes
0 forks
1 files
Last active
1 | func memberChannelPerms(g *discordgo.Guild, c *discordgo.Channel, m *discordgo.Member) int64 { |
2 | if g.OwnerID == m.User.ID { |
3 | return discordgo.PermissionAll |
4 | } |
5 | |
6 | // Get everyone role of the guild |
7 | var everyoneRole *discordgo.Role |
8 | |
9 | var roleMap = make(map[string]*discordgo.Role) |
10 | for _, role := range g.Roles { |
rootspring / reshard.go
0 likes
0 forks
1 files
Last active
1 | // Reshards an instance list |
2 | // |
3 | // EXPERIMENTAL: Set 'reshard' in experimental_features to enable this |
4 | func (l *InstanceList) Reshard() error { |
5 | if !utils.SliceContains(l.Config.ExperimentalFeatures, "reshard") { |
6 | return errors.New("reshard not enabled") |
7 | } |
8 | |
9 | if !l.RollRestarting { |
10 | return fmt.Errorf("cannot reshard during a rolling restart") |