Skip to content

Instantly share code, notes, and snippets.

View Shibe's full-sized avatar
🔍

Thom Shibe

🔍
  • Rotterdam
View GitHub Profile
@Shibe
Shibe / lichess_knight.js
Last active May 1, 2020 22:18
April fools knight for Lichess
// ==UserScript==
// @name Use the april fools knight, as knight on the board.
// @namespace http://tampermonkey.net/
// @version 0.1
// @description improves rating by 1000
// @author Shibe
// @match https://lichess.org/*
// @grant none
// ==/UserScript==
@Shibe
Shibe / fsx.CFG
Created July 30, 2019 18:44
Settings for Microsoft Flight Simulator X
[JOBSCHEDULER]
AffinityMask=14
[Bufferpools]
Poolsize=0
[GRAPHICS]
HIGHMEMFIX=1
[DISPLAY]
@Shibe
Shibe / mark-enemy-userscript.js
Last active January 9, 2019 01:25
Mark enemy scrip for Fix.
// ==UserScript==
// @name Mark Enemy Rewrite
// @version 1.0
// @author Orignal by : Martijn1279, Edited by: Thom (Rage Parrot)
// @include https://nl*.tribalwars.nl*
// @grant none
// ==/UserScript==
// RELEASE: 29-12-2018
function main() {
//ex1
let exercise1 (one : int) (two : int) (three : int) : int=
if one > two && one > three then
one
else if two > one && two > three then
two
else
three
// ex2
let exercise2 (option : Option<Option<'a>>) : Option<'a> =
package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(\b(0?[1-9]|[12]\d|30|31)[^\w\d\r\n:](0?[1-9]|1[0-2])[^\w\d\r\n:](\d{4}|\d{2})\b)|(\b(0?[1-9]|1[0-2])[^\w\d\r\n:](0?[1-9]|[12]\d|30|31)[^\w\d\r\n:](\d{4}|\d{2})\b)
`)
module SVMInterpreter
open SVMAST
open System
type State = {
memory : Literal list;
registers : Literal list;
program : Program;
pc : int;
labels : Map<string, (int)> ;
//Write a function that, given two numbers, prints "Fizz"
//if the first number is divisible by 4,
//"Buzz" if the second is divisible by 4,
//"FizzBuzz" if both are divisible by 4.
let divisible (n : int) = if (n % 4 = 0) then true else false
let questionOne (first:int) (second:int) =
if divisible first && divisible second then
"FizzBuzz"
else if divisible second then
let rec zip list1 list2 =
match list1, list2 with
| [], [] -> []
| head1 :: tail1, head2 :: tail2 -> (head1, head2) :: zip tail1 tail2
| _ -> failwith "Incorrect input"
[<EntryPoint>]
let main argv =
printfn "%A" (zip [1;2;3] [4;5;6])
0
@Shibe
Shibe / doge
Created November 24, 2016 09:55
─────────▄──────────────▄
────────▌▒█───────────▄▀▒▌
────────▌▒▒▀▄───────▄▀▒▒▒▐
───────▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐
─────▄▄▀▒▒▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐
───▄▀▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▀██▀▒▌
──▐▒▒▒▄▄▄▒▒▒▒▒▒▒▒▒▒▒▒▒▀▄▒▒▌
──▌▒▒▐▄█▀▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒▐
─▐▒▒▒▒▒▒▒▒▒▒▒▌██▀▒▒▒▒▒▒▒▒▀▄▌
─▌▒▀▄██▄▒▒▒▒▒▒▒▒▒▒▒░░░░▒▒▒▒▌
class Program
{
// Project Euler: Problem 5
static void Main(string[] args)
{
List<int> divisionRange = Enumerable.Range(1, 20).ToList();
IEnumerable<int> all = Enumerable.Range(1, Int32.MaxValue);
int res = all.First(x => Divide(x, divisionRange));