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
REBOL [Title: "REBOL Dust" Author: "Victoria Guevara" Version: 0.0.1] | |
def_setup: make object! [ | |
char_pool: "abcdefghijklmnopqrstuvwxyz0123456789" | |
domains: ['.com '.org '.net] | |
lim: 5x6 | |
] | |
cfg_file: %config.cfg | |
setup: either exists? cfg_file [load cfg_file][save/all cfg_file def_setup def_setup] | |
random/seed now |
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
# Get compiled executable there: https://github.com/Guevara-chan/packages/releases/tag/nDustman_0.01 | |
import random, nativesockets, threadpool, parsecfg, strutils, sequtils, terminal | |
const header = "# nDustman junk sites URL generator v0.01\n# Developed in 2021 by Victoria A. Guevara" | |
# Basic init. | |
randomize() | |
const config_file = "config.ini" | |
config_file.open(fmAppend).close() | |
var cfg = config_file.loadConfig() |
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 clr | |
let | |
core = load "mscorlib" | |
diag = load "System.Diagnostics.Process" | |
ipath = @(core.GetType "System.IO.Path") | |
ifile = @(core.GetType "System.IO.File") | |
idir = @(core.GetType "System.IO.Directory") | |
ithrd = @(core.GetType "System.Threading.Thread") | |
ienv = @(core.GetType "System.Environment") |
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
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # | |
# RayLib h2nim autoconverter v0.05 | |
# Developed in 2*20 by Guevara-chan | |
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # | |
[fs, rl, http] = [require('fs'), require('readline'), require('https')] if process? | |
#.{ [Procedures] | |
sanity = (name, undes = /\*/g) -> | |
name = name.replace(undes, '') | |
if name in ['type', 'end', 'from', 'div', 'ptr'] then name + 'x' else name |
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
# ~>Minesweeper core logic. | |
# ==Extnesion methods== | |
Function::getter = (name, proc) -> Object.defineProperty @prototype, name, {get: proc, configurable: true} | |
Function::setter = (name, proc) -> Object.defineProperty @prototype, name, {set: proc, configurable: true} | |
Boolean::either = (true_val, false_val = '') -> if @valueOf() then true_val else false_val | |
#.{ [Classes] | |
class Cell | |
shroud = (alert = 0b1111) << 4 | |
bomb = flag = alert # Nibble max. |
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
#.{ [Classes] | |
class Cell | |
@[name] = idx for name, idx in ['void', 'cond', 'head', 'tail'] | |
@cycle: (type, shift) -> (type + shift) %% 4 | |
# -------------------- # | |
class Automata | |
# --Methods goes here. | |
constructor: (@width = 4, @height = 4, @wrap = false) -> | |
if @clear() and @wrap | |
@get = (x, y) -> @cells[y %% @height][x %% @width] |
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('clr').init parms = | |
assemblies: ['System', 'mscorlib', 'PresentationFramework', 'Microsoft.VisualBasic', 'WindowsBase'] | |
#- Requires node-clr v0.0.17+ to work correctly. | |
Δimport = (namespace) -> Object.assign global, namespace | |
Δexport = (entity) -> module.exports[entity.name] = entity | |
repack = (array) -> array.GetValue idx for idx in [0...array.Length] | |
Function::getter = (name, proc) -> Object.defineProperty @prototype, name, {get: proc, configurable: true} | |
Function::setter = (name, proc) -> Object.defineProperty @prototype, name, {set: proc, configurable: true} | |
Function::new_branch = (name, body) -> @getter name, -> new BranchProxy @, body | |
BranchProxy = (root, body) -> |
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
EventEmitter = require('events') | |
require('clr').init {assemblies: ['CSCore.dll', 'System', 'mscorlib']} | |
Δimport = (namespace) -> Object.assign global, namespace | |
Δexport = (entity) -> module.exports[entity.name] = entity | |
Function::getter = (name, proc) -> Object.defineProperty @prototype, name, {get: proc, configurable: true} | |
Function::setter = (name, proc) -> Object.defineProperty @prototype, name, {set: proc, configurable: true} | |
#- Requires CSCore v.1.2.0+ (https://github.com/filoe/cscore) | |
Δimport CSCore | |
Δimport CSCore.Codecs | |
Δimport CSCore.SoundOut |
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
conv = require 'iconv-lite' | |
# ~/Generic patcher proc/~ | |
patch866 = (proc, args...) -> | |
decoder_tmp = (encoding = 'utf8', start, end) -> | |
Δ866 iconv.decode, new Buffer(@, start, end), encoding | |
proc_swap = () -> | |
[Buffer.prototype.toString, decoder_tmp] = [decoder_tmp, Buffer.prototype.toString] | |
Δ866 = (proc, args...) -> | |
[proc_swap(), proc(args...), proc_swap()][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
# Yet another clone of http://www.text-image.com/convert/ | |
Jimp = require('jimp') | |
class ascii_image | |
constructor: (@image, @width = 130, char_pool = "01", filters = [], random_chars = true) -> | |
# Bitmap downscaling. | |
@height = Math.max(@image.bitmap.height // (@image.bitmap.width / @width * 2.33), 1) | |
@image.resize(@width, @height) | |
# Additinal filtering. | |
for cmd in filters |
NewerOlder