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 ToolbarMenuStrings = {"Hello", "World", "Menu", "Bar", "Has", "Awesome", "MenubarSupport"} | |
local Used = {} | |
function Eval(Str) | |
local Index = 0 | |
local Current = Str:gsub('%U', '') | |
if (#Current == 0) then | |
Current = Str:gsub('%u', '') | |
end | |
while (Index < #Current+1) do | |
Index = Index + 1 |
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
--[[ | |
@name Cluster | |
@desc Clustering algorithm. Originally authored by @BadccVoid. Optimizations? | |
@example_usage Cluster.Query({Vector3.new(), Vector3.new()}):Within(20):GetCenters() --> { Vector3.new() } | |
@example_usage Cluster.Query({Vector3.new(), Vector3.new()}):Within(4):GetClusters() --> { { Vector3.new(), Vector3.new() } } | |
]] | |
-- Source | |
local Cluster = {} | |
Cluster.__index = Cluster | |
function Cluster.Query(Points) |
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
.intel_syntax noprefix # Set dialect to Intel (AT&T default for GAS) | |
.global main | |
.format: | |
.asciz "%2d\n" | |
main: | |
mov rdi, [rsi + 8] # argv[1] | |
call atoi # > eax |
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
.intel_syntax noprefix | |
.global main | |
.format: | |
.asciz "%d\n" | |
main: | |
xor rbx, rbx | |
inc rbx | |
add rsi, 8 | |
dec rdi |
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
var EXEC_FILE_LOCATION = process.argv[2] | |
var LUA_BINARY_NAME = process.argv[3] ? process.argv[3] : 'lua' | |
var chokidar = require('chokidar'); | |
var fs = require('fs'); | |
var http = require('http'); | |
var exec = require('child_process').exec | |
var responses = [] |
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 Tests = { | |
'<string name="Name">TEST</string>', -- pass | |
'<>TEST</string>', -- load | |
'< >TEST</string>', -- load | |
'<a a>TEST</string>', -- fail = not found | |
'<string a=" name="Name">TEST</string>', -- fail = not found | |
'<string a= a=""="">TEST</string>', -- ??? load |
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
-- Localized variables that I didn't copy over go here. | |
local function Solve(r0, r1, c, p) | |
local x,y,z,r00,r01,r02,r10,r11,r12,r20,r21,r22 = c:components() | |
local px,py,pz = p.x-x,p.y-y,p.z-z | |
local tx = r00*px+r10*py+r20*pz | |
local ty = r01*px+r11*py+r21*pz | |
local tz = r02*px+r12*py+r22*pz | |
local d = (tx*tx+ty*ty+tz*tz)^0.5 | |
d = r0+r1<d and r0+r1 or d |
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 Message = "This is a very powerful function and can be used in multiple ways. Used simply it can replace all instances of the pattern provided with the replacement. A pair of values is returned, the modified string and the number of substitutions made. The optional fourth argument n can be used to limit the number of substitutions made:" | |
local Methods = { | |
{ "%s+", " " }, | |
{ "are", "r" }, | |
{ "be", "b" }, | |
{ "you", "u" }, | |
{ "i%sam", "i'm" }, | |
{ "first", "1st" }, | |
{ "second", "2nd" }, |
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
// Derived from | |
// http://burtleburtle.net/bob/rand/smallprng.html | |
// TODO(alex): SSE intrinsic | |
#if !defined(AB_RAND_H) | |
#define AB_RAND_H | |
#define ULONG_MAXF 4294967295.0 // 2^32-1 | |
// Internal affixation, _ | |
// 32 bit (u4, ulong) | |
#define _ab_rand_rot(x,k) (((x)<<(k))|((x)>>(32-(k)))) |
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
#include <stdio.h> | |
#define AB_WIN | |
#include "ab.h" | |
void MatchString(char *Match, const char *String, char *Result) { | |
int StringIndex = 0; | |
int MatchLength = 0; | |
int ResultLength = 0; | |
bool Class = false; | |
bool JustRestart = false; |
OlderNewer