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
function PointWithinShape(shape, tx, ty) | |
if #shape == 0 then | |
return false | |
elseif #shape == 1 then | |
return shape[1].x == tx and shape[1].y == ty | |
elseif #shape == 2 then | |
return PointWithinLine(shape, tx, ty) | |
else | |
return CrossingsMultiplyTest(shape, tx, ty) | |
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
----------------------------------- | |
-- utilx | |
-- A project stared by Gbps | |
-- expanded with community input | |
----------------------------------- | |
utilx = {} | |
utilx.Version = 1.0 | |
-------------------- |
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
from random import choice | |
import string | |
chars = string.letters + string.digits # Python 2 | |
chars = string.ascii_letters + string.digits # Python 3 | |
rand_name = lambda x: ''.join(choice(chars) for i in range(x)) |
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
-- sb_row.lua | |
---- Scoreboard player score row, based on sandbox version | |
include("sb_info.lua") | |
local GetTranslation = LANG.GetTranslation | |
local GetPTranslation = LANG.GetParamTranslation |
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
while true ; do sleep 60 && echo `date`‘ Capturing screenshot…’ && screencapture -C -m -t jpg -x -f cap.`date +%s`.jpg ; done |
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
using System; | |
using System.Collections.Generic; | |
using System.Drawing; | |
using System.Threading; | |
using System.IO; | |
namespace Gignus | |
{ | |
class Program | |
{ |
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
// Conways game of life. | |
// init array | |
var arr = []; | |
for (var x = 1; x < 11; x++) | |
{ | |
arr[x] = []; | |
for (var y = 1; y < 11; y++) | |
{ | |
arr[x][y] = new Rect((x-1)*32, (y-1)*32, 32, 32).fill("black"); |
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
function bubbleSort( L ) | |
local newL = {} | |
for k,v in pairs( L ) do | |
if (k+1) > tableLength( L ) then -- end of the array | |
newL[k] = L[k] | |
break | |
end | |
if L[k] > L[k+1] then |
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 datetime = os.date("*t"); | |
local function convert( chars, dist, inv ) | |
return string.char( ( string.byte( chars ) - 32 + ( inv and -dist or dist ) ) % 95 + 32 ) | |
end | |
local function crypt(str, k, inv) | |
local enc= ""; | |
for i=1,#str do | |
if (#str-k[5] >= i or not inv) then |
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
public Keyboard.Key ConvertFromString(string keystr) | |
{ | |
return (Keyboard.Key) Enum.Parse(typeof (Keyboard.Key), keystr); | |
} |
OlderNewer