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
var ouis = ["oui", "ouip", "ouaip", "yup", "yep", "yes", "ouai", "oua", "ouain"]; | |
function LinearOuiHashTable(size, prime) { | |
this.content = []; | |
this._prime = prime; | |
for (var i = 0; i < size; i++) | |
this.content.push([]); | |
this.insert = (oui) => { |
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 java.io.BufferedWriter; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
public class BrainfuckCompiler { | |
public static void main(String[] args) { | |
StringBuilder sb = new StringBuilder(); | |
sb.append("import java.util.Scanner;\n"); | |
sb.append("public class BrainfuckProgram {\n"); |
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
// 177 | |
c.width=1920;e=S(t)*200;a=b=>750+b*90+e;x.font="bold 80px Times" | |
x.fillText("BLACK",750+e,380) | |
x.fillText("FLAG",880+e,680) | |
for(i=0;i<4;)x.fillRect(a(i++),i%2==0?385:400,80,220) | |
// 174 | |
c.width=1920 | |
x.font="bold 80px Times" | |
a=(u,v,w)=>x.fillText(u,v,w) |
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 sys | |
import time | |
import datetime | |
from enum import Enum | |
class TimerType(Enum): | |
POMODORO = (30, ) | |
PAUSE = (5, ) |
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 is a do-you-know-the-way sentence generator | |
var words = [ | |
["do"], | |
["you", "u"], | |
["know", "no", "kno"], | |
["da", "de", "the"], | |
["way", "wey", "wei", "wae"]], | |
combinations = [], | |
combinationNb = words.reduce((acc, v) => acc * v.length, 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
<script> | |
// tupper formula's k value, in binary | |
var kbin = "0011001010100010000101010101111100001001001010000000000000000000000000000000100000000000000010100000000000001000100000000000000000000000111111111111111111000000000000000010000011110000000000000000100000000000001110000000000000000010000000000000111000000000000000000000000000000001100000000000000100100000000000001001000000000000001100000000000000000000000000000000110000000000000010010000000000000100100000000000001111110000000000000000000000000001111111000000011100000001110011000000000000011000000000000000001111111111111111010000000000000000101111101000000000000000010101100000110010100100000100011101000110001000000000000000011111111111111110000000000000000000000001100100000000000010100100000000000100101000000000001000100010000000000000000100000000000000000000000000000001111100000000000000000000000000000110010000000000000011100000000000000000000000000111111110000000001000000000000000010010100000000000000010000000000001001010000000000010000000000000000111 |
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
type 'a binary_tree = Leaf | Node of 'a * 'a binary_tree * 'a binary_tree;; | |
let visit_binary_tree tree (visiting_function:'a binary_tree -> 'a list) :'a list = match tree with | |
| Leaf -> [] | |
| Node (_, _, _) -> visiting_function tree;; | |
(* | |
1 | |
/ \ | |
2 3 |
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
let parent = (t, i) => t[((i + 1)>>1) - 1]; | |
let kids = (t, i) => [t[2*i + 1],t[(i+1)*2]] |
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
#!/usr/bin/env python | |
""" | |
Very simple HTTP server. | |
Upon a GET or POST request, returns a json object with the route of the request | |
and the data of the request body. | |
""" | |
import socket | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
import time |
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 Vector() { | |
this.capacity = 1; | |
this.elements = new Array(this.capacity); | |
this.size = 0; | |
this.add = (element) => { | |
if (this.size > this.capacity) | |
console.err('this.size > this.capacity'); | |
if (this.size === this.capacity) { |