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
:gsub("&#%d%d%d%d;", decode) | |
function decode(str) | |
local num = tonumber(str:sub(3,6)) | |
local first = math.floor(num/4096) | |
num = num - 4096 * first | |
return string.char(first+224, math.floor(num/64)+128, num%64+128) | |
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
-- this can be a json file | |
return { | |
engine = "love-0.8.0", | |
image = "github://img/screenie.png", -- also allow "http://" | |
source = "github://src" -- if src is a folder, downlaod as zip via Ghub api, if it is a .love file then downlaod that instead | |
-- other meta | |
} | |
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
$valid_files = Array( | |
"trAInsported.love" => True; | |
); | |
if (!empty($_GET["file"]) { | |
$request = $_GET["file"]; | |
if $valid_files[$request] { | |
$path = "../downloads/" . str_replace('/', '_', $request); | |
header("Content-type: application/octet-stream"); | |
header("Content-disposition: attachment;filename=" . $request); |
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
package demoproject; | |
import java.math.BigInteger; | |
public class blah { | |
public static void main(String[] args) { | |
BigInteger big = BigInteger.valueOf(2).pow(500000).subtract(BigInteger.ONE); | |
String[] num = big.toString().split("(?!^)"); | |
int number = 0; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
-- Developer: sbx320 | |
-- License: MIT | |
-- Github Repos: https://github.com/sbx320/lua_utils | |
--// classlib | |
--|| @type: Shared | |
--|| @desc: A library providing several tools to enhance OOP with Lua | |
--|| @info: Registers itself into the global namespace | |
--\\ | |
local elementClasses = {} |
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
# replaces the contents with "$FILENAME\n======" (representing a markdown header with the filename). | |
find . -type f -exec sh -c 'printf "$1 \n======" > "$1"' sh {} \; | |
# append extension ".md" | |
find . -type f -exec sh -c 'mv "$1" "$1.md"' sh {} \; |
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
package main | |
import ( | |
"io/ioutil" | |
"log" | |
"os" | |
"path" | |
"strings" | |
) |
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
-- Developer: sbx320 | |
-- License: MIT | |
-- Github Repos: https://github.com/sbx320/lua_utils | |
--// classlib | |
--|| A library providing several tools to enhance OOP with MTA and Lua | |
--\\ | |
SERVER = triggerServerEvent == nil | |
CLIENT = not SERVER | |
DEBUG = DEBUG or false |
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
# Generate a 440 Hz square waveform in Pygame by building an array of samples and play | |
# it for 5 seconds. Change the hard-coded 440 to another value to generate a different | |
# pitch. | |
# | |
# Run with the following command: | |
# python pygame-play-tone.py | |
from array import array | |
from time import sleep |
OlderNewer