Skip to content

Instantly share code, notes, and snippets.

View tavurth's full-sized avatar

Will tavurth

  • Somewhere around Asia
View GitHub Profile
@tavurth
tavurth / AsynchronousLoading.pl
Created June 7, 2016 18:44
Coding test for sms-online.com
#! /usr/bin/perl
=begin comment
Construct a console-based application using the framework AnyEvent which takes a list of URLs on STDIN and calls them all at once in asynchronous mode.
Display the responses as they are received and statistics for each call rate slashes after the completion of all calls.
=cut
use strict;
@tavurth
tavurth / Assert_binsearch.pl
Last active June 7, 2016 19:14
Binary search task for sms-online.com
#! /usr/bin/perl
use strict;
use warnings;
use ImyaFamiliyaLatinitseyFindIndex;
# Make sure that we have the say command availible
sub say { print @_, "\n" }
# Create a class instance
@tavurth
tavurth / cl-sdl2.lisp
Last active October 9, 2017 22:39
cl-sdl2 test suite
(ql:quickload :sdl2/examples)
(ql:quickload :glkit-examples)
(ql:quickload :sdl2kit-examples)
(defpackage :test
(:use :cl)
(:export :*is-new* :try-call))
(in-package :test)
(use-package :kit.gl.test)
class Forbidden extends Error {
constructor(message, status = 403) {
super(message);
this.status = status;
}
getStatus() {
return Number.parseInt(this.status);
}
// foo(foo(bar))blim => foobaroofblim
function reverse(string) {
return string
.split('')
.reverse()
.join('');
}
function checkRecursion(input) {
const inputString = '(console.log (add 3 5 8 123 (minus 32 2 2 2)))';
const commands = {
'console.log': console.log,
inc(a, b) {
return Number.parseInt(a) + Number.parseInt(b);
},
dec(a, b) {
return Number.parseInt(a) - Number.parseInt(b);
},
@tavurth
tavurth / FuzzyTesting.js
Last active September 6, 2020 18:52
Fuzzy Testing
/**
* Original code, found in an inherited project
*/
function original(item, currentLocale) {
const { message } = item;
if (!message.translation) return true;
if (
message.translation.lastTranslated !== undefined &&
@tavurth
tavurth / zero_approach.ipynb
Created August 15, 2020 07:45
Zero approach in python pandas
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tavurth
tavurth / FTD.ipynb
Last active February 17, 2021 09:04
Failure to deliver for GME and AMC
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tavurth
tavurth / Promise.all.gd
Created April 9, 2023 14:06
Promise.all for Godot 4
class_name Promise
extends Resource
signal completed(results)
var _funcs: Array[Callable]
var _completed := false
var _results: Dictionary