Skip to content

Instantly share code, notes, and snippets.

View MrStonedOne's full-sized avatar
🎯
Focusing

Kyle Spier-Swenson MrStonedOne

🎯
Focusing
View GitHub Profile
//here is some mouse proc debugging code you can use in a test project to figure out how mouse calls work.
/client
Click(...)
world << "[.....]([args.Join(", ")]) = `[. = ..()]`\n"
MouseDown()
world << "[.....]([args.Join(", ")]) = `[. = ..()]`\n"
MouseUp()
world << "[.....]([args.Join(", ")]) = `[. = ..()]`\n"
MouseDrag()
#!/bin/bash
cd ~/git/tgstation
git fetch
git reset --hard origin/master
git clean -df
DreamMaker -o tgstation.dme > ~/web/public/objecttree.xml
zip -jD9 /home/static/web/public/byond/tgstation.zip tgstation.rsc
cd ..
remote: error: refs/__gh__/svn/v4 does not point to a valid object!
remote: error: refs/heads/gh-pages does not point to a valid object!
remote: error: refs/heads/revert-51005-misc-defines does not point to a valid object!
remote: error: refs/pull/50697/merge does not point to a valid object!
remote: error: refs/pull/50708/head does not point to a valid object!
remote: error: refs/pull/50744/merge does not point to a valid object!
remote: error: refs/pull/50752/head does not point to a valid object!
remote: error: refs/pull/50753/head does not point to a valid object!
remote: error: refs/pull/50758/head does not point to a valid object!
remote: error: refs/pull/50774/head does not point to a valid object!
@MrStonedOne
MrStonedOne / assetcheck.php
Last active August 14, 2020 20:17
cdn assets
<?php
// wait until the file requested exists.
// requires nginx auth_request and http_gzip_static modules
//only answer requests for files that are in this folder:
$asset_root = '/var/www/global-asset-store/';
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$document_root = $_SERVER['DOCUMENT_ROOT'];
$computed_path = $document_root.$path;
@MrStonedOne
MrStonedOne / file.st
Last active December 1, 2020 22:58
byond can't into smb
write(2, "normal:\n", 8) = 8
stat64("/tgs/instances/Configuration/GameStaticFiles/config.old/config.txt", {st_dev=makedev(0x8, 0x2), st_ino=400984, st_mode=S_IFREG|0644, st_nlink=1, st_uid=1000, st_gid=1000, st_blksize=4096, st_blocks=48, st_size=22853, st_atime=1606819126 /* 2020-12-01T10:38:46.112356826+0000 */, st_atime_nsec=112356826, st_mtime=1588998179 /* 2020-05-09T04:22:59+0000 */, st_mtime_nsec=0, st_ctime=1594251182 /* 2020-07-08T23:33:02.666931978+0000 */, st_ctime_nsec=666931978}) = 0
write(2, "fexists=1\n", 10) = 10
openat(AT_FDCWD, "/tgs/instances/Configuration/GameStaticFiles/config.old/config.txt", O_RDONLY) = 4
fstat64(4, {st_dev=makedev(0x8, 0x2), st_ino=400984, st_mode=S_IFREG|0644, st_nlink=1, st_uid=1000, st_gid=1000, st_blksize=4096, st_blocks=48, st_size=22853, st_atime=1606819126 /* 2020-12-01T10:38:46.112356826+0000 */, st_atime_nsec=112356826, st_mtime=1588998179 /* 2020-05-09T04:22:59+0000 */, st_mtime_nsec=0, st_ctime=1594251182 /* 2020-07-08T23:33:02.666
@MrStonedOne
MrStonedOne / README.md
Last active January 5, 2021 08:43 — forked from Log1x/README.md
Uptime Robot Discord Webhook

Uptime Robot Webhook for Discord

Configuration

  • Alert Contact Type: Web-Hook
  • URL to Notify: https://discordapp.com/api/webhooks/CHANGEME/CHANGEME?
    • Must end with ?

[x] Send as JSON (application/json).

@MrStonedOne
MrStonedOne / 1gistfile1.txt
Last active April 14, 2021 00:36
/tg/ list length stats.
Shortly after map load:
All List Stats: (round(log(2,list.len)))
0: 20996
1: 18639
2: 33842
4: 7067
8: 3171
16: 227
32: 122
<?php
//Record the votes:
$votes = array(); //array of ckeys assoicated to an array of dicts with vote metadata for each pick the player picked
$candidates = array(); //array of dicts
//grab each vote from the db
while ($row = $res->fetch_assoc()) {
$vote = array();
$ckey = $row['ckey'];
$cid = $row['optionid'];
world
fps = 25 // 25 frames per second
icon_size = 32 // 32x32 icon size by default
view = 6 // show up to 6 tiles outward from center (13x13 view)
//this is like this because its how the bot runs this code, and i wanted to repo the bug as seen by the bot.
var/b = new /a()
/a/New()
var/list/types = list()
for (var/datum/typepath as anything in typesof(/datum))
@MrStonedOne
MrStonedOne / breakdown.txt
Created February 28, 2022 04:40
typecache vs istype realworld
typecache_size=1 istype_size=1 count = 2102 typecache = 0.00486952 istype = 0.0100201
typecache_size=2 istype_size=2 count = 27 typecache = 0.00527306 istype = 0.00397598
typecache_size=3 istype_size=1 count = 257 typecache = 0.00114017 istype = 0.00145129
typecache_size=4 istype_size=1 count = 15 typecache = 0.0031474 istype = 0.00425723
typecache_size=4 istype_size=4 count = 20 typecache = 0.00287879 istype = 0.00792816
typecache_size=9 istype_size=1 count = 4 typecache = 0.00223673 istype = 0.00292081
typecache_size=19 istype_size=2 count = 18 typecache = 0.00152456 istype = 0.00148972
typecache_size=20 istype_size=3 count = 5900 typecache = 0.0023313 istype = 0.00363955
typecache_size=29 istype_size=4 count = 270 typecache = 0.00289221 istype = 0.00459528
typecache_size=32 istype_size=5 count = 179054 typecache = 0.00272347 istype = 0.0050234