This file contains 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 strutils | |
import sdl2 | |
type | |
ListenerPtr = proc (action: Action) {.closure.} | |
Action* = ref object | |
active: bool | |
kind: string | |
keysyms: seq[cint] |
This file contains 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 requests | |
from bs4 import BeautifulSoup | |
from time import sleep | |
forumID = 32 | |
# Get the required form content | |
request = requests.get("https://forum.roblox.com/Forum/ShowForum.aspx?ForumID={}".format(forumID)) | |
soup = BeautifulSoup(request.text, "html.parser") |
This file contains 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 algorithm | |
import strutils | |
proc splitChars(str: string): seq[char] = | |
result = @[] | |
for ch in str: | |
add result, ch | |
proc translateSimple(text: string): string = | |
## Translates ASCII to JoshScript |
This file contains 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
-- Operations definitions | |
local operations = { | |
["+"] = { | |
Arguments = 2, | |
Operation = function(a, b) return a + b end | |
}, | |
["-"] = { | |
Arguments = 2, | |
Operation = function(a, b) return a - b end | |
}, |
This file contains 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
local Vector2 = {} | |
function Vector2.new(x, y) | |
local mt = {} | |
local unit,magnitude | |
x = x or 0 | |
y = y or 0 | |
function mt:__index(i) |
This file contains 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
(require 'json) | |
(defun sort-json (point) | |
"Sort JSON-like structure surrounding the point." | |
(interactive "d") | |
(let ((object-begin (nth 1 (syntax-ppss point))) | |
(begin-point (point))) | |
(when object-begin | |
(goto-char object-begin) | |
(forward-list) |
NewerOlder